Package org.tweetyproject.comparator
Class Order<T>
java.lang.Object
org.tweetyproject.comparator.Order<T>
- Type Parameters:
T
- The class that is being ordered.
This class represents an order among some objects.
- Author:
- Matthias Thimm
-
Constructor Summary
ConstructorDescriptionOrder
(Collection<T> objects) Creates a new order for the given set of objects. -
Method Summary
Modifier and TypeMethodDescriptionDefaultGraph<Order<T>.org.tweetyproject.comparator.Order.OrderNode>
Returns the elements appearing in this order.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 object2toString()
-
Constructor Details
-
Order
Creates a new order for the given set of objects.- Parameters:
objects
- some set of objects.
-
-
Method Details
-
removeNode
Removes the given node and all of its relations.- Parameters:
n
- The object whose node will be removed
-
setOrderedBefore
Adds that object1 is ordered before object2- Parameters:
object1
- some objectobject2
- some object
-
isOrderedBefore
Checks whether object1 is ordered before object2.- Parameters:
object1
- some object.object2
- some object.- Returns:
- "true" if object1 is ordered before object2.
-
isComparable
- Parameters:
object1
- 1st objectobject2
- 2nd object- Returns:
- whether the objects are comparable
-
getElements
Returns the elements appearing in this order.- Returns:
- the elements appearing in this order.
-
toString
-
getDefaultGraph
- Returns:
- the directed defaultGraph that represents the order
-
getNodes
- Returns:
- the bijection between objects and nodes in the defaultGraph
-