Interface RuleSet

All Superinterfaces:
ImmutableRuleSet, Iterable<Rule>
All Known Subinterfaces:
Ontology
All Known Implementing Classes:
AbstractRuleSet, DefaultOntology, IndexedByBodyPredicatesRuleSet, IndexedByHeadPredicatesRuleSet, LinkedListRuleSet

public interface RuleSet extends ImmutableRuleSet
Mutable rule set contract.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(Rule rule)
    Adds a rule to this set.
    boolean
    addAll(CloseableIterator<Rule> ruleIterator)
    Adds all rules provided by the specified closeable iterator.
    boolean
    addAll(Iterator<Rule> ruleIterator)
    Adds all rules provided by the specified iterator.
    boolean
    contains(Rule rule)
    Returns whether the specified rule is present in this set.
    boolean
    Returns whether this set contains no rule.
     
    boolean
    remove(Rule rule)
    Removes a rule from this set.
    boolean
    Removes all rules provided by the specified closeable iterator.
    boolean
    removeAll(Iterator<Rule> ruleIterator)
    Removes all rules provided by the specified iterator.
    int
    Returns the number of rules contained in this set.

    Methods inherited from interface Iterable

    forEach, spliterator
  • Method Details

    • add

      boolean add(Rule rule)
      Adds a rule to this set.
      Parameters:
      rule - the rule to add
      Returns:
      true if this set changed as a result of the call
    • addAll

      boolean addAll(Iterator<Rule> ruleIterator)
      Adds all rules provided by the specified iterator.
      Parameters:
      ruleIterator - the rules to add
      Returns:
      true if this set changed as a result of the call
    • addAll

      boolean addAll(CloseableIterator<Rule> ruleIterator) throws RuleSetException
      Adds all rules provided by the specified closeable iterator.
      Parameters:
      ruleIterator - the rules to add
      Returns:
      true if this set changed as a result of the call
      Throws:
      RuleSetException - if the iteration fails
    • remove

      boolean remove(Rule rule)
      Removes a rule from this set.
      Parameters:
      rule - the rule to remove
      Returns:
      true if this set changed as a result of the call
    • removeAll

      boolean removeAll(Iterator<Rule> ruleIterator)
      Removes all rules provided by the specified iterator.
      Parameters:
      ruleIterator - the rules to remove
      Returns:
      true if this set changed as a result of the call
    • removeAll

      boolean removeAll(CloseableIterator<Rule> ruleIterator) throws RuleSetException
      Removes all rules provided by the specified closeable iterator.
      Parameters:
      ruleIterator - the rules to remove
      Returns:
      true if this set changed as a result of the call
      Throws:
      RuleSetException - if the iteration fails
    • isEmpty

      boolean isEmpty()
      Description copied from interface: ImmutableRuleSet
      Returns whether this set contains no rule.
      Specified by:
      isEmpty in interface ImmutableRuleSet
      Returns:
      true if this set is empty
    • contains

      boolean contains(Rule rule)
      Description copied from interface: ImmutableRuleSet
      Returns whether the specified rule is present in this set.
      Specified by:
      contains in interface ImmutableRuleSet
      Parameters:
      rule - the rule to search for
      Returns:
      true if the rule is present
    • size

      int size()
      Description copied from interface: ImmutableRuleSet
      Returns the number of rules contained in this set.
      Specified by:
      size in interface ImmutableRuleSet
      Returns:
      the number of rules contained in this set.
    • iterator

      Iterator<Rule> iterator()
      Specified by:
      iterator in interface ImmutableRuleSet
      Specified by:
      iterator in interface Iterable<Rule>