Interface RuleSet
- All Superinterfaces:
ImmutableRuleSet, Iterable<Rule>
- All Known Subinterfaces:
Ontology
- All Known Implementing Classes:
AbstractRuleSet, DefaultOntology, IndexedByBodyPredicatesRuleSet, IndexedByHeadPredicatesRuleSet, LinkedListRuleSet
Mutable rule set contract.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds a rule to this set.booleanaddAll(CloseableIterator<Rule> ruleIterator) Adds all rules provided by the specified closeable iterator.booleanAdds all rules provided by the specified iterator.booleanReturns whether the specified rule is present in this set.booleanisEmpty()Returns whether this set contains no rule.iterator()booleanRemoves a rule from this set.booleanremoveAll(CloseableIterator<Rule> ruleIterator) Removes all rules provided by the specified closeable iterator.booleanRemoves all rules provided by the specified iterator.intsize()Returns the number of rules contained in this set.Methods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
add
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
-
addAll
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
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
-
removeAll
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:ImmutableRuleSetReturns whether this set contains no rule.- Specified by:
isEmptyin interfaceImmutableRuleSet- Returns:
- true if this set is empty
-
contains
Description copied from interface:ImmutableRuleSetReturns whether the specified rule is present in this set.- Specified by:
containsin interfaceImmutableRuleSet- Parameters:
rule- the rule to search for- Returns:
- true if the rule is present
-
size
int size()Description copied from interface:ImmutableRuleSetReturns the number of rules contained in this set.- Specified by:
sizein interfaceImmutableRuleSet- Returns:
- the number of rules contained in this set.
-
iterator
-