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 an AtomicClass. 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 the removeValue(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 current AtomicClass is not finished and cannot be instantiated. Therefore, the AtomicObject can 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:
  • Field Details

    • LOG_SUPER_PREDICATE_MUST_BE_DEFINED_IN_INHERITED_PREDICATE

      static final String LOG_SUPER_PREDICATE_MUST_BE_DEFINED_IN_INHERITED_PREDICATE
      See Also:
  • Method Details

    • addValue

      void addValue(AtomicObject newValue)
      Adds the value to the value set. The add command is not propagated to including orders.
      Parameters:
      newValue - a AtomicObject object
    • getValues

      List<AtomicObject> getValues()

      getValues.

      Returns:
      An array of all values in this predicate.
    • hasValueOrder

      boolean hasValueOrder()

      hasValueOrder.

      Returns:
      true if a value order is defined, otherwise false
      See Also:
    • 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 - a AtomicObject object
    • 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) and removeValue(AtomicObject) this method propagates the update to all included value orders.

      Parameters:
      oldValue - a AtomicObject object
      newValue - a AtomicObject object
    • isInherited

      boolean isInherited()
      Specifies whether the values of the superclass are to be inherited
      Returns:
      false by default
    • setInheritance

      void setInheritance(boolean value)
      Updates the inheritance value to true or false
      Parameters:
      value -