Interface InstanceIntervalPredicate

All Superinterfaces:
InstancePredicate
All Known Implementing Classes:
InstanceIntervalPredicateImpl

public interface InstanceIntervalPredicate extends InstancePredicate
The InstanceIntervalPredicate defines an interval on totally ordered elements. The interval is specified by a minimum and maximum value using the methods setMinimum(AtomicObject) and setMaximum(AtomicObject)

During editing the relations between maximum and minimum can be wrong. The relation is only be fixed during finishing the predicate. Consequently, this method can be return a wrong value if the predicate is not finished.

Author:
Rainer Maximini
  • Method Details

    • getMaximum

      AtomicObject getMaximum()

      getMaximum.

      Returns:
      the upper bound of the interval
    • setMaximum

      void setMaximum(AtomicObject maxValue)
      Defines the maximum value of the interval.
      Parameters:
      maxValue - the upper bound of the interval
    • getMinimum

      AtomicObject getMinimum()

      getMinimum.

      Returns:
      the lower bound of the interval
    • setMinimum

      void setMinimum(AtomicObject minValue)
      Defines the minimum value of the interval.
      Parameters:
      minValue - the lower bound of the interval
    • holdsFor

      boolean holdsFor(AtomicObject value) throws UncomparableObjectsException
      Checks if the given totally ordered value is an element of the interval. The method returns true if one of the following relations are true
      • value == getMinimum()
      • value == getMaximum()
      • value.before(getMaximum()) && value.after(getMinimum())

      During editing the relations between maximum and minimum can be wrong. The relation is only be fixed during finishing the predicate. Consequently, this method can be return a wrong value if the predicate is not finished.

      Parameters:
      value - A totally ordered object.
      Returns:
      true if value in included in the interval
      Throws:
      UncomparableObjectsException - is thrown if value does not match to the bounds of the predicate
    • after

      boolean after(AtomicObject intervalObject, AtomicObject otherIntervalObject) throws UncomparableObjectsException
      Checks, if an object of NumericClass or ChronologicClass is after another object of the same class.
      Parameters:
      intervalObject - The object from which the order comparison starts.
      otherIntervalObject - The object that is checked if it is after the other object.
      Returns:
      true if other is after this.
      Throws:
      UncomparableObjectsException - is thrown if the object are not comparable
    • before

      boolean before(AtomicObject intervalObject, AtomicObject otherIntervalObject) throws UncomparableObjectsException
      Checks, if an object of NumericClass or ChronologicClass is before another object of the same class.
      Parameters:
      intervalObject - The object from which the order comparison starts.
      otherIntervalObject - The object that is checked if it is before the other object.
      Returns:
      true if other is before this.
      Throws:
      UncomparableObjectsException - is thrown if the object are not comparable