Interface InstanceEnumerationPredicate
-
- All Superinterfaces:
InstancePredicate
- All Known Subinterfaces:
InstanceTaxonomyOrderPredicate,InstanceTotalOrderPredicate,InstanceValueOrderPredicate
- All Known Implementing Classes:
InstanceEnumerationPredicateImpl,InstanceTaxonomyOrderPredicateImpl,InstanceTotalOrderPredicateImpl,InstanceValueOrderPredicateImpl
public interface InstanceEnumerationPredicate extends InstancePredicate
The instance enumeration predicate can be used to define a set of possible values for anAtomicClass. Additionally, these values can be ordered as a taxonomy or as a total order.To add value to the predicate use the
addValue(AtomicObject)method and to remove a value use theremoveValue(AtomicObject)method. Both methods do not propagate the value to including value orders. Consequently, an inconsistency can occur between the predicate and the value orders that should be avoided.Furthermore, both methods using
AtomicObjects as values that can not be of the same type because currentAtomicClassis not finished and cannot be instantiated. Therefore, theAtomicObjectcan be an instance of the system super class (@link de.uni_trier.wi2.procake.data.model.DataClass#getSystemSuperClass()}.Another constraint that must be fulfilled is that the values of the predicate must be a sub set or equal of the values of the predicate of the super class. Of course, this only true if the super class contains a predicate.
Another constraint that must be fulfilled is that the values of the predicate must be a sub set or equal of the values of the predicate of the super class. Of course, this only true if the super class contains a predicate.
- Author:
- Rainer Maximini
- See Also:
InstanceTotalOrderPredicate,InstanceTaxonomyOrderPredicate
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddValue(AtomicObject newValue)Adds the value to the value set.List<AtomicObject>getValues()getValues.booleanhasValueOrder()hasValueOrder.voidremoveValue(AtomicObject value)Removes the object from the value set if the value exists.voidupdateValue(AtomicObject oldValue, AtomicObject newValue)Updates the value in this predicate as well as in all including orders.-
Methods inherited from interface de.uni_trier.wi2.procake.data.model.base.InstancePredicate
getAtomicClass, holdsFor, isEnumerationPredicate, isIntervalPredicate, isTaxonomyOrderPredicate, isTotalOrderPredicate
-
-
-
-
Method Detail
-
addValue
void addValue(AtomicObject newValue)
Adds the value to the value set. The add command is not propagated to including orders.- Parameters:
newValue- aAtomicObjectobject
-
getValues
List<AtomicObject> getValues()
getValues.
- Returns:
- An array of all values in this predicate.
-
hasValueOrder
boolean hasValueOrder()
hasValueOrder.
- Returns:
trueif a value order is defined, otherwisefalse- See Also:
InstanceValueOrderPredicate,addValue(AtomicObject)
-
removeValue
void removeValue(AtomicObject value)
Removes the object from the value set if the value exists. The remove command is not propagated to including orders.- Parameters:
value- aAtomicObjectobject
-
updateValue
void updateValue(AtomicObject oldValue, AtomicObject newValue)
Updates the value in this predicate as well as in all including orders. The update is only be done if the old value exists and the new one not.In opposite to
addValue(AtomicObject)andremoveValue(AtomicObject)this method propagates the update to all included value orders.- Parameters:
oldValue- aAtomicObjectobjectnewValue- aAtomicObjectobject
-
-