Class Order<T>

java.lang.Object
org.tweetyproject.comparator.Order<T>
Type Parameters:
T - The class that is being ordered.

public class Order<T> extends Object
This class represents an order among some objects.
Author:
Matthias Thimm
  • Constructor Details

    • Order

      public Order(Collection<T> objects)
      Creates a new order for the given set of objects.
      Parameters:
      objects - some set of objects.
  • Method Details

    • removeNode

      public void removeNode(T n)
      Removes the given node and all of its relations.
      Parameters:
      n - The object whose node will be removed
    • setOrderedBefore

      public void setOrderedBefore(T object1, T object2)
      Adds that object1 is ordered before object2
      Parameters:
      object1 - some object
      object2 - some object
    • isOrderedBefore

      public boolean isOrderedBefore(T object1, T object2)
      Checks whether object1 is ordered before object2.
      Parameters:
      object1 - some object.
      object2 - some object.
      Returns:
      "true" if object1 is ordered before object2.
    • isComparable

      public boolean isComparable(T object1, T object2)
      Parameters:
      object1 - 1st object
      object2 - 2nd object
      Returns:
      whether the objects are comparable
    • getElements

      public Collection<T> getElements()
      Returns the elements appearing in this order.
      Returns:
      the elements appearing in this order.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDefaultGraph

      public DefaultGraph<Order<T>.org.tweetyproject.comparator.Order.OrderNode> getDefaultGraph()
      Returns:
      the directed defaultGraph that represents the order
    • getNodes

      public Map<T,Order<T>.org.tweetyproject.comparator.Order.OrderNode> getNodes()
      Returns:
      the bijection between objects and nodes in the defaultGraph