Class OrderRelation

java.lang.Object
FAtiMA.Core.plans.OrderRelation
All Implemented Interfaces:
Serializable, Cloneable

public class OrderRelation extends Object implements Cloneable, Serializable
Represents an order relation between a step and other steps in the plan
Author:
Joao Dias
See Also:
  • Constructor Details

    • OrderRelation

      public OrderRelation(Integer stepID)
      Creates a new empty OrderRelation between a step and other steps in the plan
      Parameters:
      stepID - - the ID of the main Step referenced by this OrderRelation
  • Method Details

    • getStepID

      public Integer getStepID()
      Gets the ID of the main step in the order relation
    • getAfter

      public ArrayList<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 ArrayList<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(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(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(Integer stepID)
      Asserts that the received Step must occur before this step
      Parameters:
      stepID - - the ID of the step to insert before
    • clone

      public Object clone()
      Clones this OrderRelation, returning an equal copy. If this clone is changed afterwards, the original object remains the same.
      Overrides:
      clone in class Object
      Returns:
      The OrderRelations's copy.