stella
Class AbstractTarget.ConstraintAdapter

java.lang.Object
  extended by stella.AbstractTarget.ConstraintAdapter
All Implemented Interfaces:
Appointable.Constraint
Direct Known Subclasses:
ParsedTarget.Constraint, PointingScheduler.HeightConstraint, PointingScheduler.SolarConstraint
Enclosing class:
AbstractTarget

public abstract static class AbstractTarget.ConstraintAdapter
extends Object
implements Appointable.Constraint

An adapter class for Appointable.Constraints.


Constructor Summary
AbstractTarget.ConstraintAdapter()
           
 
Method Summary
 Comparable getAbove()
          Returns the upper bound of the forbiddn parameter space.
 Comparable getBelow()
          Returns the lower bound of the forbiddn parameter space.
 Comparable getFrom()
          Returns the lower bound of the allowed parameter space.
 Comparable getMax()
          Returns the maximum of the allowed parameter space.
 Comparable<?> getMin()
          Returns the minimum of the allowed parameter space.
 long getTimeForConstraint(ParameterClustering set, TargetDefinition target)
          Returns the time remaining for this constraint.
 Comparable getTo()
          Returns the upper bound of the allowed parameter space.
 boolean isSatisfied(ParameterClustering set, TargetDefinition target)
          Implements the stella.Scheduling.Constraint method and diverts it to calculating the remaining time.
 String toString()
          Returns the name of the variable plus the apllied constraint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.Appointable.Constraint
getValueName
 

Constructor Detail

AbstractTarget.ConstraintAdapter

public AbstractTarget.ConstraintAdapter()
Method Detail

getMin

public Comparable<?> getMin()
Returns the minimum of the allowed parameter space. If the contraint is no minimum-constraint, this returns null.

Specified by:
getMin in interface Appointable.Constraint

getMax

public Comparable getMax()
Returns the maximum of the allowed parameter space. If the contraint is no maximum-constraint, this returns null.

Specified by:
getMax in interface Appointable.Constraint

getFrom

public Comparable getFrom()
Returns the lower bound of the allowed parameter space. If the contraint is no from-to-constraint, this returns null.

Specified by:
getFrom in interface Appointable.Constraint

getTo

public Comparable getTo()
Returns the upper bound of the allowed parameter space. If the contraint is no from-to-constraint, this returns null.

Specified by:
getTo in interface Appointable.Constraint

getBelow

public Comparable getBelow()
Returns the lower bound of the forbiddn parameter space. If the contraint is no below-above-constraint, this returns null.

Specified by:
getBelow in interface Appointable.Constraint

getAbove

public Comparable getAbove()
Returns the upper bound of the forbiddn parameter space. If the contraint is no below-above-constraint, this returns null.

Specified by:
getAbove in interface Appointable.Constraint

isSatisfied

public boolean isSatisfied(ParameterClustering set,
                           TargetDefinition target)
Implements the stella.Scheduling.Constraint method and diverts it to calculating the remaining time. If no time is remaining, false is returned.

Specified by:
isSatisfied in interface Appointable.Constraint

getTimeForConstraint

public long getTimeForConstraint(ParameterClustering set,
                                 TargetDefinition target)
Returns the time remaining for this constraint. First, the parameter cluster is queried for the parameter with the name #valuename. Then, the type of constraint is checked and the current value of the parameter is checked against the constraints. If the parameter is out of bounds, zero is returned. Otherwise, the parameter is checked for being Increasing or Decreasing. Depending on the constraint type, this property of the parameter is used to fetch a remaining time. If the parameter does not supply a Increasing or Decreasing information, the maximum time is returned.

Specified by:
getTimeForConstraint in interface Appointable.Constraint

toString

public String toString()
Returns the name of the variable plus the apllied constraint.

Overrides:
toString in class Object