Class Order<T>

  • Type Parameters:
    T - The class that is being ordered.

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

      Constructors 
      Constructor Description
      Order​(java.util.Collection<T> objects)
      Creates a new order for the given set of objects.
    • Method Summary

      Modifier and Type Method Description
      DefaultGraph<net.sf.tweety.graphs.orders.Order.OrderNode> getDefaultGraph()  
      java.util.Collection<T> getElements()
      Returns the elements appearing in this order.
      java.util.Map<T,​net.sf.tweety.graphs.orders.Order.OrderNode> getNodes()  
      boolean isComparable​(T object1, T object2)  
      boolean isOrderedBefore​(T object1, T object2)
      Checks whether object1 is ordered before object2.
      void removeNode​(T n)
      Removes the given node and all of its relations.
      void setOrderedBefore​(T object1, T object2)
      Adds that object1 is ordered before object2
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Order

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

      • 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)
      • getElements

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

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

        public DefaultGraph<net.sf.tweety.graphs.orders.Order.OrderNode> getDefaultGraph()
        Returns:
        the directed defaultGraph that represents the order
      • getNodes

        public java.util.Map<T,​net.sf.tweety.graphs.orders.Order.OrderNode> getNodes()
        Returns:
        the bijection between objects and nodes in the defaultGraph