Class ConstraintBase
- java.lang.Object
-
- net.ssehub.easy.reasoning.core.reasoner.ConstraintList
-
- net.ssehub.easy.reasoning.core.reasoner.ConstraintBase
-
- All Implemented Interfaces:
java.lang.Iterable<Constraint>
public class ConstraintBase extends ConstraintList
Implements the constraint base, a combination of linked list and map in order to quickly store, retrieve and delete constraints to be evaluated.- Author:
- Holger Eichelberger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.ssehub.easy.reasoning.core.reasoner.ConstraintList
ConstraintList.IModificationListener, ConstraintList.Node
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<Constraint,ConstraintList.Node>mapping-
Fields inherited from class net.ssehub.easy.reasoning.core.reasoner.ConstraintList
modCount
-
-
Constructor Summary
Constructors Constructor Description ConstraintBase()Constructs an empty constraint base.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(Constraint constraint)Returnstrueif this list contains the specifiedconstraint.booleanremoveAll(java.util.Collection<? extends Constraint> constraints)Removes all elements from this list, which are also inconstraints.-
Methods inherited from class net.ssehub.easy.reasoning.core.reasoner.ConstraintList
add, addAll, addAll, addAll, addAll, addAll, addAll, addFirst, addLast, clear, getFirst, getLast, indexOf, isEmpty, iterator, pop, removeFirst, removeLast, setModificationListener, size, toArray, toCollection, toString, unlink
-
-
-
-
Field Detail
-
mapping
private java.util.Map<Constraint,ConstraintList.Node> mapping
-
-
Method Detail
-
contains
public boolean contains(Constraint constraint)
Description copied from class:ConstraintListReturnstrueif this list contains the specifiedconstraint. More formally, returnstrueif and only if this list contains at least one constraintconstraintsuch thato == constraint.- Overrides:
containsin classConstraintList- Parameters:
constraint- the constraint whose presence in this list is to be tested- Returns:
trueif this list contains the specified element
-
removeAll
public boolean removeAll(java.util.Collection<? extends Constraint> constraints)
Description copied from class:ConstraintListRemoves all elements from this list, which are also inconstraints.- Overrides:
removeAllin classConstraintList- Parameters:
constraints- the elements to remove- Returns:
- the removed elements
-
-