jopt.csp.spi.arcalgorithm.variable
Class NumExprBase

java.lang.Object
  extended byjopt.csp.spi.arcalgorithm.variable.VariableChangeBase
      extended byjopt.csp.spi.arcalgorithm.variable.NumExprBase
All Implemented Interfaces:
jopt.csp.variable.CspNumExpr, NumExpr, TrigExpr, VariableChangeSource
Direct Known Subclasses:
DoubleExpr, FloatExpr, GenericNumExprBase, IntExpr, LongExpr

public abstract class NumExprBase
extends VariableChangeBase
implements jopt.csp.variable.CspNumExpr, NumExpr


Method Summary
 void addVariableChangeListener(VariableChangeListener listener)
          Adds a listener interested in variable change events
 jopt.csp.variable.CspConstraint between(jopt.csp.variable.CspGenericNumConstant min, boolean minExclusive, jopt.csp.variable.CspGenericNumConstant max, boolean maxExclusive)
          Returns a constraint restricting this expression to be between a min and max.
 jopt.csp.variable.CspConstraint between(jopt.csp.variable.CspGenericNumConstant min, jopt.csp.variable.CspGenericNumConstant max)
          Returns a constraint restricting this expression to be between or equal min and max.
 jopt.csp.variable.CspConstraint between(jopt.csp.variable.CspNumExpr min, boolean minExclusive, jopt.csp.variable.CspNumExpr max, boolean maxExclusive)
          Returns a constraint restricting this expression to be between a min and max.
 jopt.csp.variable.CspConstraint between(jopt.csp.variable.CspNumExpr min, jopt.csp.variable.CspNumExpr max)
          Returns a constraint restricting this expression to be between or equal min and max.
 jopt.csp.variable.CspConstraint eq(jopt.csp.variable.CspNumExpr val)
          Returns constraint restricting this expression to a value
 boolean equals(java.lang.Object obj)
          Allows for equality comparisons between NumExprBase objects
 jopt.csp.variable.CspConstraint geq(jopt.csp.variable.CspNumExpr val)
          Returns constraint restricting this expression to values above and including a given minimum
 Arc[] getBooleanSourceArcs()
          Returns array of arcs that will affect the boolean true / false value of this constraint upon a change
 NumDomain getDomain()
          Returns domain associated with this expression
 java.lang.String getName()
          Returns the name of this expression
 java.util.Collection getNodeCollection()
          Returns collection of all nodes used to build this expression
 jopt.csp.variable.CspConstraint gt(jopt.csp.variable.CspNumExpr val)
          Returns constraint restricting this expression to values above a given minimum
 int hashCode()
          Returns a hash code based on this variable's name (if one exists)
 boolean isBound()
          Returns true if this expression's domain is bound to a value
 jopt.csp.variable.CspConstraint leq(jopt.csp.variable.CspNumExpr val)
          Returns constraint restricting this expression to values below and including a given maximum
 jopt.csp.variable.CspConstraint lt(jopt.csp.variable.CspNumExpr val)
          Returns constraint restricting this expression to values below a given maximum
 jopt.csp.variable.CspConstraint neq(jopt.csp.variable.CspNumExpr val)
          Returns constraint restricting this expression to all values not equivalent to supplied value
 jopt.csp.variable.CspConstraint notBetween(jopt.csp.variable.CspGenericNumConstant min, boolean minExclusive, jopt.csp.variable.CspGenericNumConstant max, boolean maxExclusive)
          Returns a constraint restricting this expression to not fall within a given range from a min to max value
 jopt.csp.variable.CspConstraint notBetween(jopt.csp.variable.CspGenericNumConstant min, jopt.csp.variable.CspGenericNumConstant max)
          Returns a constraint restricting this expression to not fall within a given range greater than or equal to a min value up to less than or equal a max value
 jopt.csp.variable.CspConstraint notBetween(jopt.csp.variable.CspNumExpr min, boolean minExclusive, jopt.csp.variable.CspNumExpr max, boolean maxExclusive)
          Returns a constraint restricting this expression to not fall within a given range from a min to max value
 jopt.csp.variable.CspConstraint notBetween(jopt.csp.variable.CspNumExpr min, jopt.csp.variable.CspNumExpr max)
          Returns a constraint restricting this expression to not fall within a given range greater than or equal to a min value up to less than or equal a max value
 void removeVariableChangeListener(VariableChangeListener listener)
          Removes a variable listener from this variable
 void setName(java.lang.String name)
          Sets the name of this expression
 java.lang.String toString()
           
 void updateGraph(NodeArcGraph graph)
          Adds arcs representing this expression to the node arc graph
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jopt.csp.spi.arcalgorithm.constraint.num.NumExpr
getNextHigher, getNextLower, getNode, getNumberType, getNumMax, getNumMin, getPrecision, setPrecision
 
Methods inherited from interface jopt.csp.spi.util.TrigExpr
isInDomain
 

Method Detail

setName

public final void setName(java.lang.String name)
Sets the name of this expression

Specified by:
setName in interface jopt.csp.variable.CspNumExpr

getName

public final java.lang.String getName()
Returns the name of this expression

Specified by:
getName in interface jopt.csp.variable.CspNumExpr

getDomain

public final NumDomain getDomain()
Returns domain associated with this expression


isBound

public boolean isBound()
Returns true if this expression's domain is bound to a value

Specified by:
isBound in interface jopt.csp.variable.CspNumExpr

getNodeCollection

public java.util.Collection getNodeCollection()
Returns collection of all nodes used to build this expression

Specified by:
getNodeCollection in interface NumExpr

getBooleanSourceArcs

public Arc[] getBooleanSourceArcs()
Returns array of arcs that will affect the boolean true / false value of this constraint upon a change

Specified by:
getBooleanSourceArcs in interface NumExpr

updateGraph

public void updateGraph(NodeArcGraph graph)
Adds arcs representing this expression to the node arc graph

Specified by:
updateGraph in interface NumExpr

eq

public jopt.csp.variable.CspConstraint eq(jopt.csp.variable.CspNumExpr val)
Returns constraint restricting this expression to a value

Specified by:
eq in interface jopt.csp.variable.CspNumExpr

leq

public jopt.csp.variable.CspConstraint leq(jopt.csp.variable.CspNumExpr val)
Returns constraint restricting this expression to values below and including a given maximum

Specified by:
leq in interface jopt.csp.variable.CspNumExpr

lt

public jopt.csp.variable.CspConstraint lt(jopt.csp.variable.CspNumExpr val)
Returns constraint restricting this expression to values below a given maximum

Specified by:
lt in interface jopt.csp.variable.CspNumExpr

gt

public jopt.csp.variable.CspConstraint gt(jopt.csp.variable.CspNumExpr val)
Returns constraint restricting this expression to values above a given minimum

Specified by:
gt in interface jopt.csp.variable.CspNumExpr

geq

public jopt.csp.variable.CspConstraint geq(jopt.csp.variable.CspNumExpr val)
Returns constraint restricting this expression to values above and including a given minimum

Specified by:
geq in interface jopt.csp.variable.CspNumExpr

neq

public jopt.csp.variable.CspConstraint neq(jopt.csp.variable.CspNumExpr val)
Returns constraint restricting this expression to all values not equivalent to supplied value

Specified by:
neq in interface jopt.csp.variable.CspNumExpr

between

public jopt.csp.variable.CspConstraint between(jopt.csp.variable.CspNumExpr min,
                                               boolean minExclusive,
                                               jopt.csp.variable.CspNumExpr max,
                                               boolean maxExclusive)
Returns a constraint restricting this expression to be between a min and max.

Specified by:
between in interface jopt.csp.variable.CspNumExpr
Parameters:
min - value that this expression must be greater than
minExclusive - true if start of range does not include minimum value
max - value that this expression must be less than
maxExclusive - true if end of range does not include maximum value
Returns:
constraint restricting this expression to be between a min and max.

between

public jopt.csp.variable.CspConstraint between(jopt.csp.variable.CspNumExpr min,
                                               jopt.csp.variable.CspNumExpr max)
Returns a constraint restricting this expression to be between or equal min and max.

Specified by:
between in interface jopt.csp.variable.CspNumExpr
Parameters:
min - value that this expression must be greater than
max - value that this expression must be less than
Returns:
constraint restricting this expression to be between or equal to min and max

between

public jopt.csp.variable.CspConstraint between(jopt.csp.variable.CspGenericNumConstant min,
                                               boolean minExclusive,
                                               jopt.csp.variable.CspGenericNumConstant max,
                                               boolean maxExclusive)
Returns a constraint restricting this expression to be between a min and max.

Specified by:
between in interface jopt.csp.variable.CspNumExpr
Parameters:
min - value that this expression must be greater than
minExclusive - true if start of range does not include minimum value
max - value that this expression must be less than
maxExclusive - true if end of range does not include maximum value
Returns:
constraint restricting this expression to be between a min and max.

between

public jopt.csp.variable.CspConstraint between(jopt.csp.variable.CspGenericNumConstant min,
                                               jopt.csp.variable.CspGenericNumConstant max)
Returns a constraint restricting this expression to be between or equal min and max.

Specified by:
between in interface jopt.csp.variable.CspNumExpr
Parameters:
min - value that this expression must be greater than
max - value that this expression must be less than
Returns:
constraint restricting this expression to be between or equal to min and max

notBetween

public jopt.csp.variable.CspConstraint notBetween(jopt.csp.variable.CspNumExpr min,
                                                  boolean minExclusive,
                                                  jopt.csp.variable.CspNumExpr max,
                                                  boolean maxExclusive)
Returns a constraint restricting this expression to not fall within a given range from a min to max value

Specified by:
notBetween in interface jopt.csp.variable.CspNumExpr
Parameters:
min - start of values that this expression may not contain
minExclusive - true if start of range does not include minimum value
max - start of values that this expression may not contain
maxExclusive - true if end of range does not include maximum value
Returns:
constraint restricting this expression to not fall within a given range

notBetween

public jopt.csp.variable.CspConstraint notBetween(jopt.csp.variable.CspNumExpr min,
                                                  jopt.csp.variable.CspNumExpr max)
Returns a constraint restricting this expression to not fall within a given range greater than or equal to a min value up to less than or equal a max value

Specified by:
notBetween in interface jopt.csp.variable.CspNumExpr
Parameters:
min - start of values that this expression may not contain
max - start of values that this expression may not contain
Returns:
constraint restricting this expression to not fall within a given range

notBetween

public jopt.csp.variable.CspConstraint notBetween(jopt.csp.variable.CspGenericNumConstant min,
                                                  boolean minExclusive,
                                                  jopt.csp.variable.CspGenericNumConstant max,
                                                  boolean maxExclusive)
Returns a constraint restricting this expression to not fall within a given range from a min to max value

Specified by:
notBetween in interface jopt.csp.variable.CspNumExpr
Parameters:
min - start of values that this expression may not contain
minExclusive - true if start of range does not include minimum value
max - start of values that this expression may not contain
maxExclusive - true if end of range does not include maximum value
Returns:
constraint restricting this expression to not fall within a given range

notBetween

public jopt.csp.variable.CspConstraint notBetween(jopt.csp.variable.CspGenericNumConstant min,
                                                  jopt.csp.variable.CspGenericNumConstant max)
Returns a constraint restricting this expression to not fall within a given range greater than or equal to a min value up to less than or equal a max value

Specified by:
notBetween in interface jopt.csp.variable.CspNumExpr
Parameters:
min - start of values that this expression may not contain
max - start of values that this expression may not contain
Returns:
constraint restricting this expression to not fall within a given range

hashCode

public int hashCode()
Returns a hash code based on this variable's name (if one exists)


equals

public final boolean equals(java.lang.Object obj)
Allows for equality comparisons between NumExprBase objects

Parameters:
obj -
Returns:
true if the specified object is a NumExprBase and its name is identical to this NumExprBase object

toString

public java.lang.String toString()

addVariableChangeListener

public void addVariableChangeListener(VariableChangeListener listener)
Adds a listener interested in variable change events

Specified by:
addVariableChangeListener in interface VariableChangeSource
Overrides:
addVariableChangeListener in class VariableChangeBase

removeVariableChangeListener

public void removeVariableChangeListener(VariableChangeListener listener)
Removes a variable listener from this variable

Specified by:
removeVariableChangeListener in interface VariableChangeSource
Overrides:
removeVariableChangeListener in class VariableChangeBase