Class OrderRelation

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class OrderRelation
    extends java.lang.Object
    implements java.lang.Cloneable, java.io.Serializable
    Represents 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.Object clone()
      Clones this OrderRelation, returning an equal copy.
      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.
      java.util.ArrayList<java.lang.Integer> getAfter()
      Gets the id's of all steps that occur after the main step
      java.util.ArrayList<java.lang.Integer> getBefore()
      Gets the id's of all steps that occur before the main step
      java.lang.Integer getStepID()
      Gets the ID of the main step in the order relation
      void InsertAfter​(java.lang.Integer stepID)
      Asserts that the received Step must occur after this step
      void InsertBefore​(java.lang.Integer stepID)
      Asserts that the received Step must occur before this step
      • Methods inherited from class java.lang.Object

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

      • OrderRelation

        public OrderRelation​(java.lang.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 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:
        clone in class java.lang.Object
        Returns:
        The OrderRelations's copy.