com.prozima.pengine
Class Constraint

java.lang.Object
  extended by com.prozima.pengine.Constraint
All Implemented Interfaces:
java.lang.Cloneable

public class Constraint
extends java.lang.Object
implements java.lang.Cloneable

Places bounds on the scheduled start and finish dates of an activity or milestone.


Nested Class Summary
static class Constraint.ConstraintType
          Type of constraint.
 
Constructor Summary
Constraint()
          Create a new Constraint with the default constraint type of Constraint.ConstraintType.NONE.
 
Method Summary
 Constraint clone()
           
 boolean equals(java.lang.Object obj)
          Two Constraints are equals if the type is the same and the boundary dates are the same.
 java.util.Date getEarlyFinishDate()
          Get the earliest allowed date before which the associated schedule node cannot finish.
 java.util.Date getEarlyStartDate()
          Get the earliest allowed date before which the associated schedule node cannot begin.
 java.util.Date getLateFinishDate()
          Get the latest allowed date after which the associated schedule node cannot finish.
 java.util.Date getLateStartDate()
          Get the latest allowed date after which the associated schedule node cannot begin.
 Constraint.ConstraintType getType()
          Get the type of the constraint.
 int hashCode()
          Depends on the type of constraint and the four boundary dates.
 boolean set(Constraint.ConstraintType inType, java.util.Date inDate)
          Configure the constraint by setting its type and bounding date.
 boolean set(Constraint.ConstraintType inType, java.util.Date inBeginDate, java.util.Date inEndDate)
          Configure the Constraint by setting its type and bounding dates.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Constraint

public Constraint()
Create a new Constraint with the default constraint type of Constraint.ConstraintType.NONE.

Method Detail

clone

public Constraint clone()
                 throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

equals

public boolean equals(java.lang.Object obj)
Two Constraints are equals if the type is the same and the boundary dates are the same.

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

getEarlyFinishDate

public java.util.Date getEarlyFinishDate()
Get the earliest allowed date before which the associated schedule node cannot finish.

Returns:
Earliest allowed finish date or null if there is no constraint on this date.

getEarlyStartDate

public java.util.Date getEarlyStartDate()
Get the earliest allowed date before which the associated schedule node cannot begin.

Returns:
Earliest allowed start date or null if there is no constraint on this date.

getLateFinishDate

public java.util.Date getLateFinishDate()
Get the latest allowed date after which the associated schedule node cannot finish.

Returns:
Latest allowed finish date or null if there is no constraint on this date.

getLateStartDate

public java.util.Date getLateStartDate()
Get the latest allowed date after which the associated schedule node cannot begin.

Returns:
Latest allowed start date or null if there is no constraint on this date.

getType

public Constraint.ConstraintType getType()
Get the type of the constraint.

Returns:
ConstraintType The type of the constraint. null is never returned.

hashCode

public int hashCode()
Depends on the type of constraint and the four boundary dates.

Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

set

public boolean set(Constraint.ConstraintType inType,
                   java.util.Date inDate)
Configure the constraint by setting its type and bounding date.

Parameters:
inType - The constraint type. This method only accepts constraint types that require a single boundary date i.e. MSXD and MFXD are not supported.
inDate - The boundary date.
Returns:
true if the parameters are correct, otherwise false.

set

public boolean set(Constraint.ConstraintType inType,
                   java.util.Date inBeginDate,
                   java.util.Date inEndDate)
Configure the Constraint by setting its type and bounding dates.

Parameters:
inType - The constraint type. This method only accepts constraint types that require a two boundary dates i.e. MSXD and MFXD are supported, other types are not.
inBeginDate - Earliest boundary date.
inEndDate - Latest to boundary dates.
Returns:
true if the parameters are correct, otherwise false.