jopt.csp.spi.arcalgorithm.variable
Class LongVariable

java.lang.Object
  extended byjopt.csp.spi.arcalgorithm.variable.VariableChangeBase
      extended byjopt.csp.spi.arcalgorithm.variable.NumExprBase
          extended byjopt.csp.spi.arcalgorithm.variable.LongExpr
              extended byjopt.csp.spi.arcalgorithm.variable.LongVariable
All Implemented Interfaces:
jopt.csp.variable.CspDoubleCast, jopt.csp.variable.CspFloatCast, jopt.csp.variable.CspLongCast, jopt.csp.variable.CspLongExpr, jopt.csp.variable.CspLongVariable, jopt.csp.variable.CspNumExpr, jopt.csp.variable.CspNumVariable, jopt.csp.variable.CspVariable, DoubleCast, FloatCast, LongCast, NumExpr, Storable, TrigExpr, Variable, VariableChangeSource

public class LongVariable
extends LongExpr
implements jopt.csp.variable.CspLongVariable, Variable


Constructor Summary
LongVariable(java.lang.String name, BaseLongDomain domain)
          Constructor
LongVariable(java.lang.String name, LongCast expr)
          Constructor
LongVariable(java.lang.String name, long min, long max)
          Constructor
LongVariable(java.lang.String name, LongVariable var)
          Constructor
 
Method Summary
 void clearDelta()
          Clears the delta set for this variable's domain
 java.lang.Object clone()
          Clones this variables
 long getNextHigher(long val)
          Returns the next higher value in this variable's domain or current value if none exists
 long getNextLower(long val)
          Returns the next lower value in this variable's domain or current value if none exists
 int getSize()
          Returns the size of this variable's domain
 java.lang.Object getState()
          Stores appropriate data for future restoration.
 boolean isInDomain(long val)
          Returns true if value is in this variable's domain
 void removeAll(jopt.csp.util.LongSet vals)
          Attempts to remove a set of values from this variable's domain
 void removeDomainRange(java.lang.Number start, java.lang.Number end)
          Attempts to reduce this variable's domain by removing a range of values
 void removeDomainValue(java.lang.Number val)
          Attempts to remove a single value from this variable's domain
 void removeDomainValues(jopt.csp.util.NumSet vals)
          Attempts to reduce this variable's domain by removing a set of values
 void removeRange(long start, long end)
          Attempts to reduce this variable's domain by removing a range of values
 void removeValue(long val)
          Attempts to remove a single value from this variable's domain
 void restoreState(java.lang.Object state)
          Restores variable information from stored data.
 void setDomainMax(java.lang.Number val)
          Attempts to reduce this variable's domain to be less than the specified maximum value.
 void setDomainMin(java.lang.Number val)
          Attempts to reduce this variable's domain to be less than the specified maximum value.
 void setDomainRange(java.lang.Number start, java.lang.Number end)
          Attempts to reduce this variable's domain to within a range of values
 void setDomainValue(java.lang.Number val)
          Attempts to reduce this variable's domain to a single value.
 void setDomainValues(jopt.csp.util.NumSet s)
          Attempts to reduce this variable's domain by restricting it to a set of values
 void setMax(long val)
          Attempts to reduce this variable's domain to be less than the specified maximum value.
 void setMin(long val)
          Attempts to reduce this variable's domain to be greater than the specified minimum value.
 void setRange(long start, long end)
          Attempts to reduce this variable's domain to within a range of values
 void setValue(long val)
          Attempts to reduce this variable's domain to a single value.
 
Methods inherited from class jopt.csp.spi.arcalgorithm.variable.LongExpr
add, add, add, add, add, add, between, between, divide, divide, divide, divide, divide, divide, eq, eq, geq, geq, getDoubleDomain, getFloatDomain, getLongDomain, getMax, getMin, getNextHigher, getNextLower, getNode, getNumberType, getNumMax, getNumMin, getPrecision, gt, gt, isInDomain, leq, leq, lt, lt, multiply, multiply, multiply, multiply, multiply, multiply, neq, neq, notBetween, notBetween, setPrecision, subtract, subtract, subtract, subtract, subtract, subtract
 
Methods inherited from class jopt.csp.spi.arcalgorithm.variable.NumExprBase
addVariableChangeListener, between, between, between, between, eq, equals, geq, getBooleanSourceArcs, getDomain, getName, getNodeCollection, gt, hashCode, isBound, leq, lt, neq, notBetween, notBetween, notBetween, notBetween, removeVariableChangeListener, setName, toString, updateGraph
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jopt.csp.variable.CspLongVariable
getMax, getMin
 
Methods inherited from interface jopt.csp.variable.CspLongExpr
add, add, add, add, add, add, between, between, divide, divide, divide, divide, divide, divide, eq, eq, geq, geq, gt, gt, leq, leq, lt, lt, multiply, multiply, multiply, multiply, multiply, multiply, neq, neq, notBetween, notBetween, subtract, subtract, subtract, subtract, subtract, subtract
 
Methods inherited from interface jopt.csp.variable.CspNumExpr
between, between, between, between, eq, geq, getName, gt, isBound, leq, lt, neq, notBetween, notBetween, notBetween, notBetween, setName
 
Methods inherited from interface jopt.csp.variable.CspVariable
getName, isBound
 
Methods inherited from interface jopt.csp.spi.arcalgorithm.variable.Variable
updateGraph
 
Methods inherited from interface jopt.csp.spi.util.Storable
getName
 
Methods inherited from interface jopt.csp.spi.arcalgorithm.constraint.num.NumExpr
getBooleanSourceArcs, getName, getNodeCollection, isBound, updateGraph
 

Constructor Detail

LongVariable

public LongVariable(java.lang.String name,
                    BaseLongDomain domain)
Constructor


LongVariable

public LongVariable(java.lang.String name,
                    long min,
                    long max)
Constructor


LongVariable

public LongVariable(java.lang.String name,
                    LongVariable var)
Constructor


LongVariable

public LongVariable(java.lang.String name,
                    LongCast expr)
Constructor

Method Detail

getSize

public int getSize()
Returns the size of this variable's domain

Specified by:
getSize in interface jopt.csp.variable.CspVariable

isInDomain

public boolean isInDomain(long val)
Returns true if value is in this variable's domain

Specified by:
isInDomain in interface jopt.csp.variable.CspLongVariable

setMax

public void setMax(long val)
            throws jopt.csp.variable.PropagationFailureException
Attempts to reduce this variable's domain to be less than the specified maximum value.

Specified by:
setMax in interface jopt.csp.variable.CspLongVariable
Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

setDomainMax

public void setDomainMax(java.lang.Number val)
                  throws jopt.csp.variable.PropagationFailureException
Attempts to reduce this variable's domain to be less than the specified maximum value.

Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

setDomainMin

public void setDomainMin(java.lang.Number val)
                  throws jopt.csp.variable.PropagationFailureException
Attempts to reduce this variable's domain to be less than the specified maximum value.

Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

setMin

public void setMin(long val)
            throws jopt.csp.variable.PropagationFailureException
Attempts to reduce this variable's domain to be greater than the specified minimum value.

Specified by:
setMin in interface jopt.csp.variable.CspLongVariable
Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

setValue

public void setValue(long val)
              throws jopt.csp.variable.PropagationFailureException
Attempts to reduce this variable's domain to a single value.

Specified by:
setValue in interface jopt.csp.variable.CspLongVariable
Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

setDomainValue

public void setDomainValue(java.lang.Number val)
                    throws jopt.csp.variable.PropagationFailureException
Attempts to reduce this variable's domain to a single value.

Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

setDomainValues

public void setDomainValues(jopt.csp.util.NumSet s)
                     throws jopt.csp.variable.PropagationFailureException
Attempts to reduce this variable's domain by restricting it to a set of values

Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

removeValue

public void removeValue(long val)
                 throws jopt.csp.variable.PropagationFailureException
Attempts to remove a single value from this variable's domain

Specified by:
removeValue in interface jopt.csp.variable.CspLongVariable
Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

removeAll

public void removeAll(jopt.csp.util.LongSet vals)
               throws jopt.csp.variable.PropagationFailureException
Attempts to remove a set of values from this variable's domain

Specified by:
removeAll in interface jopt.csp.variable.CspLongVariable
Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

removeDomainValue

public void removeDomainValue(java.lang.Number val)
                       throws jopt.csp.variable.PropagationFailureException
Attempts to remove a single value from this variable's domain

Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

removeDomainValues

public void removeDomainValues(jopt.csp.util.NumSet vals)
                        throws jopt.csp.variable.PropagationFailureException
Attempts to reduce this variable's domain by removing a set of values

Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

setRange

public void setRange(long start,
                     long end)
              throws jopt.csp.variable.PropagationFailureException
Attempts to reduce this variable's domain to within a range of values

Specified by:
setRange in interface jopt.csp.variable.CspLongVariable
Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

removeRange

public void removeRange(long start,
                        long end)
                 throws jopt.csp.variable.PropagationFailureException
Attempts to reduce this variable's domain by removing a range of values

Specified by:
removeRange in interface jopt.csp.variable.CspLongVariable
Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

setDomainRange

public void setDomainRange(java.lang.Number start,
                           java.lang.Number end)
                    throws jopt.csp.variable.PropagationFailureException
Attempts to reduce this variable's domain to within a range of values

Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

removeDomainRange

public void removeDomainRange(java.lang.Number start,
                              java.lang.Number end)
                       throws jopt.csp.variable.PropagationFailureException
Attempts to reduce this variable's domain by removing a range of values

Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

getNextHigher

public long getNextHigher(long val)
Returns the next higher value in this variable's domain or current value if none exists

Specified by:
getNextHigher in interface jopt.csp.variable.CspLongVariable

getNextLower

public long getNextLower(long val)
Returns the next lower value in this variable's domain or current value if none exists

Specified by:
getNextLower in interface jopt.csp.variable.CspLongVariable

clearDelta

public void clearDelta()
Clears the delta set for this variable's domain


getState

public java.lang.Object getState()
Stores appropriate data for future restoration.

Specified by:
getState in interface Storable

restoreState

public void restoreState(java.lang.Object state)
Restores variable information from stored data.

Specified by:
restoreState in interface Storable

clone

public java.lang.Object clone()
Clones this variables