jopt.csp.spi.arcalgorithm.graph.node
Interface NumNode

All Superinterfaces:
ChoicePointDataSource, Node, NodeChangeSource, Storable, TrigExpr
All Known Implementing Classes:
DoubleNode, FloatNode, IntNode, LongNode

public interface NumNode
extends Node, NodeChangeSource, TrigExpr


Method Summary
 jopt.csp.util.NumberIterator deltaValues()
          Returns iterator of values in node's delta
 jopt.csp.util.NumSet getDomain()
          Returns domain of node as a set of Number and NumInterval objects
 java.lang.Number getMax()
          Returns the maximum domain value for this node
 java.lang.Number getMin()
          Returns the minimum domain value for this node
 java.lang.Number getNextHigher(java.lang.Number n)
          Returns the next higher domain value for a given n.
 java.lang.Number getNextLower(java.lang.Number n)
          Returns the next lower domain value for a given n.
 int getNumberType()
          Returns the type of number this node is based on.
 double getPrecision()
          Returns precision associated with this domain for real numbers
 boolean isInDomain(java.lang.Number val)
          Returns true if value is in domain
 void removeDomain(jopt.csp.util.NumSet s)
          Removes all values in this node's domain contained within set S
 void removeRange(java.lang.Number start, java.lang.Number end)
          Removes a range of values from the domain of this node
 void removeValue(java.lang.Number n)
          Removes a single value from the domain of this node
 void setDomain(jopt.csp.util.NumSet s)
          Restricts node's domain to values contained within set S
 void setMax(java.lang.Number n)
          Restricts domain to all values less than or equal to value given
 void setMin(java.lang.Number n)
          Restricts domain to all values greater than or equal to value given
 void setRange(java.lang.Number start, java.lang.Number end)
          Restricts domain of this node to a range of values
 void setValue(java.lang.Number n)
          Restricts domain to a single value
 jopt.csp.util.NumberIterator values()
          Returns iterator of values in node's domain
 
Methods inherited from interface jopt.csp.spi.arcalgorithm.graph.node.Node
addedToGraph, choicePointStackSet, clearDelta, getName, getSize, inGraph, isBound, isInDomain, removedFromGraph, setChoicePointStack, setName
 
Methods inherited from interface jopt.csp.spi.util.Storable
getState, restoreState
 
Methods inherited from interface jopt.csp.spi.arcalgorithm.graph.node.NodeChangeSource
addDomainChangeListener, addRangeChangeListener, addValueChangeListener, removeDomainChangeListener, removeRangeChangeListener, removeValueChangeListener
 
Methods inherited from interface jopt.csp.spi.util.TrigExpr
getNumMax, getNumMin
 

Method Detail

getMax

public java.lang.Number getMax()
Returns the maximum domain value for this node


getMin

public java.lang.Number getMin()
Returns the minimum domain value for this node


getNextHigher

public java.lang.Number getNextHigher(java.lang.Number n)
Returns the next higher domain value for a given n. Returns n if no higher value exists


getNextLower

public java.lang.Number getNextLower(java.lang.Number n)
Returns the next lower domain value for a given n. Returns n if no lower value exists


setMax

public void setMax(java.lang.Number n)
            throws jopt.csp.variable.PropagationFailureException
Restricts domain to all values less than or equal to value given

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

setMin

public void setMin(java.lang.Number n)
            throws jopt.csp.variable.PropagationFailureException
Restricts domain to all values greater than or equal to value given

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

removeValue

public void removeValue(java.lang.Number n)
                 throws jopt.csp.variable.PropagationFailureException
Removes a single value from the domain of this node

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

setValue

public void setValue(java.lang.Number n)
              throws jopt.csp.variable.PropagationFailureException
Restricts domain to a single value

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

removeRange

public void removeRange(java.lang.Number start,
                        java.lang.Number end)
                 throws jopt.csp.variable.PropagationFailureException
Removes a range of values from the domain of this node

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

setRange

public void setRange(java.lang.Number start,
                     java.lang.Number end)
              throws jopt.csp.variable.PropagationFailureException
Restricts domain of this node to a range of values

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

removeDomain

public void removeDomain(jopt.csp.util.NumSet s)
                  throws jopt.csp.variable.PropagationFailureException
Removes all values in this node's domain contained within set S

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

setDomain

public void setDomain(jopt.csp.util.NumSet s)
               throws jopt.csp.variable.PropagationFailureException
Restricts node's domain to values contained within set S

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

getDomain

public jopt.csp.util.NumSet getDomain()
Returns domain of node as a set of Number and NumInterval objects

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

isInDomain

public boolean isInDomain(java.lang.Number val)
Returns true if value is in domain

Specified by:
isInDomain in interface TrigExpr

values

public jopt.csp.util.NumberIterator values()
Returns iterator of values in node's domain


deltaValues

public jopt.csp.util.NumberIterator deltaValues()
Returns iterator of values in node's delta


getPrecision

public double getPrecision()
Returns precision associated with this domain for real numbers


getNumberType

public int getNumberType()
Returns the type of number this node is based on.