Class LinkedListRuleSet
java.lang.Object
fr.lirmm.graphik.integraal.core.ruleset.AbstractRuleSet
fr.lirmm.graphik.integraal.core.ruleset.LinkedListRuleSet
- All Implemented Interfaces:
ImmutableRuleSet, RuleSet, Iterable<Rule>, Collection<Rule>
- Direct Known Subclasses:
IndexedByBodyPredicatesRuleSet, IndexedByHeadPredicatesRuleSet
Rule set implementation backed by a linked list.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty rule set.LinkedListRuleSet(CloseableIterator<?> parser) Creates a rule set from parser output filtered down to rules.LinkedListRuleSet(Iterable<Rule> rules) Creates a rule set from an iterable of rules.LinkedListRuleSet(Iterator<Rule> rules) Creates a rule set from an iterator. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds a rule to this set.booleanaddAll(Collection<? extends Rule> c) voidclear()booleanReturns whether the specified rule is present in this set.booleanbooleancontainsAll(Collection<?> c) booleanisEmpty()Returns whether this set contains no rule.iterator()booleanRemoves a rule from this set.booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()Returns the number of rules contained in this set.Object[]toArray()<T> T[]toArray(T[] a) toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
LinkedListRuleSet
public LinkedListRuleSet()Creates an empty rule set. -
LinkedListRuleSet
-
LinkedListRuleSet
Creates a rule set from parser output filtered down to rules.- Parameters:
parser- the parser iterator- Throws:
RuleSetException- if the parser cannot be consumed as a rule set
-
LinkedListRuleSet
-
-
Method Details
-
contains
Description copied from interface:ImmutableRuleSetReturns whether the specified rule is present in this set.- Specified by:
containsin interfaceImmutableRuleSet- Specified by:
containsin interfaceRuleSet- Parameters:
rule- the rule to search for- Returns:
- true if the rule is present
-
add
-
remove
-
iterator
-
addAll
- Specified by:
addAllin interfaceCollection<Rule>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Rule>
-
contains
- Specified by:
containsin interfaceCollection<Rule>
-
containsAll
- Specified by:
containsAllin interfaceCollection<Rule>
-
isEmpty
public boolean isEmpty()Description copied from interface:ImmutableRuleSetReturns whether this set contains no rule.- Specified by:
isEmptyin interfaceCollection<Rule>- Specified by:
isEmptyin interfaceImmutableRuleSet- Specified by:
isEmptyin interfaceRuleSet- Returns:
- true if this set is empty
-
remove
- Specified by:
removein interfaceCollection<Rule>
-
removeAll
- Specified by:
removeAllin interfaceCollection<Rule>
-
retainAll
- Specified by:
retainAllin interfaceCollection<Rule>
-
size
public int size()Description copied from interface:ImmutableRuleSetReturns the number of rules contained in this set.- Specified by:
sizein interfaceCollection<Rule>- Specified by:
sizein interfaceImmutableRuleSet- Specified by:
sizein interfaceRuleSet- Returns:
- the number of rules contained in this set.
-
toArray
- Specified by:
toArrayin interfaceCollection<Rule>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<Rule>
-
toString
- Overrides:
toStringin classAbstractRuleSet
-