Package FAtiMA.Core.plans
Class OrderRelation
- java.lang.Object
-
- FAtiMA.Core.plans.OrderRelation
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class OrderRelation extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableRepresents an order relation between a step and other steps in the plan- Author:
- Joao Dias
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OrderRelation(java.lang.Integer stepID)Creates a new empty OrderRelation between a step and other steps in the plan
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Clones this OrderRelation, returning an equal copy.intCompare(java.lang.Integer stepID)Compares a given step with the main step in the Order Relation if the received step occurs before, the function returns +1.java.util.ArrayList<java.lang.Integer>getAfter()Gets the id's of all steps that occur after the main stepjava.util.ArrayList<java.lang.Integer>getBefore()Gets the id's of all steps that occur before the main stepjava.lang.IntegergetStepID()Gets the ID of the main step in the order relationvoidInsertAfter(java.lang.Integer stepID)Asserts that the received Step must occur after this stepvoidInsertBefore(java.lang.Integer stepID)Asserts that the received Step must occur before this step
-
-
-
Method Detail
-
getStepID
public java.lang.Integer getStepID()
Gets the ID of the main step in the order relation
-
getAfter
public java.util.ArrayList<java.lang.Integer> getAfter()
Gets the id's of all steps that occur after the main step- Returns:
- the id's stored in a arraylist
-
getBefore
public java.util.ArrayList<java.lang.Integer> getBefore()
Gets the id's of all steps that occur before the main step- Returns:
- the id's stored in a arraylist
-
Compare
public int Compare(java.lang.Integer stepID)
Compares a given step with the main step in the Order Relation if the received step occurs before, the function returns +1. -1 if the received step occurs after, and 0 if no order relation is defined- Parameters:
stepID- - the ID of the step to compare
-
InsertAfter
public void InsertAfter(java.lang.Integer stepID)
Asserts that the received Step must occur after this step- Parameters:
stepID- - the ID of the step to insert after
-
InsertBefore
public void InsertBefore(java.lang.Integer stepID)
Asserts that the received Step must occur before this step- Parameters:
stepID- - the ID of the step to insert before
-
clone
public java.lang.Object clone()
Clones this OrderRelation, returning an equal copy. If this clone is changed afterwards, the original object remains the same.- Overrides:
clonein classjava.lang.Object- Returns:
- The OrderRelations's copy.
-
-