Interface InstanceTotalOrderPredicate

All Superinterfaces:
InstanceEnumerationPredicate, InstancePredicate, InstanceValueOrderPredicate
All Known Implementing Classes:
InstanceTotalOrderPredicateImpl

public interface InstanceTotalOrderPredicate extends InstanceValueOrderPredicate
A TotalOrder orderes the values of a InstanceEnumerationPredicate in a totally ordered list.

Each total order contains a list of all values of the corresponding InstanceEnumerationPredicate. The value can be appended with add(AtomicObject) or inserted at a specific position with insertAt(int, AtomicObject).

The values must be defined in the InstanceEnumerationPredicate and all value of the predicate must be ordered. Both constraints are checked during the finishing process of the corresponding AtomicClass.

Author:
Rainer Maximini
See Also:
  • Method Details

    • add

      Adds the value at the end of the total order
      Parameters:
      value - a AtomicObject object
      Throws:
      ObjectAlreadyExistsException - is thrown when the value is already in the order.
    • elementAt

      AtomicObject elementAt(int index)
      Returns the element at the specified position in this list.
      Parameters:
      index - index of element to return.
      Returns:
      the element at the specified position in this list.
    • indexOf

      int indexOf(AtomicObject value) throws ObjectNotFoundException
      Returns the index in this order of the specified value. If the order does not contain this value an exception will be thrown.
      Parameters:
      value - element to search for.
      Returns:
      the index in this order of the specified value
      Throws:
      ObjectNotFoundException - Is thrown when the value is not an element of the order.
    • insertAt

      void insertAt(int index, AtomicObject value) throws ObjectAlreadyExistsException
      Insert value at at specified index position. All values up from this are moved one index further.
      Parameters:
      index - a int
      value - a AtomicObject object
      Throws:
      ObjectAlreadyExistsException - Is thrown when the value is already in the order.
    • size

      int size()
      The number of values in this order.
      Returns:
      The number of values in this order.