jopt.csp.spi.arcalgorithm.domain
Class BaseLongDomain

java.lang.Object
  extended byjopt.csp.spi.arcalgorithm.domain.AbstractDomain
      extended byjopt.csp.spi.arcalgorithm.domain.BaseNumDomain
          extended byjopt.csp.spi.arcalgorithm.domain.BaseLongDomain
All Implemented Interfaces:
ChoicePointDataSource, ChoicePointEntryListener, Domain, DomainChangeSource, LongDomain, NumDomain
Direct Known Subclasses:
LongIntervalDomain, LongSparseDomain

public abstract class BaseLongDomain
extends BaseNumDomain
implements LongDomain

Base class for long domains


Method Summary
 void dump()
           
 long getMax()
          Returns maximum value of domain
 long getMin()
          Returns minimum value of domain
 long getNextHigher(long val)
          Returns the next higher value in the domain or current value if none exists
 long getNextLower(long val)
          Returns the next lower value in the domain or current value if none exists
 boolean isBound()
          Returns true if domain is bound to a value
 boolean isInDomain(long val)
          Returns true if value is in domain
 void removeDomain(jopt.csp.util.NumSet s)
          Attempts to reduce a domain by removing a set of values
 void removeRange(long start, long end)
          Attempts to reduce domain by removing a range of values
 void removeValue(long val)
          Attempts to remove a single value from the domain
 void setDomain(jopt.csp.util.NumSet s)
          Attempts to reduce a domain by restricting it to a set of values
 void setMax(long val)
          Attempts to reduce domain to a maximum value.
 void setMin(long val)
          Attempts to reduce domain to a minimum value.
 void setRange(long start, long end)
          Attempts to reduce domain to within a range of values
 void setValue(long val)
          Attempts to reduce domain to a single value.
 
Methods inherited from class jopt.csp.spi.arcalgorithm.domain.BaseNumDomain
clearDelta, clone, deltaValues, getDeltaSet, getDomainState, getSize, isNestedChild, restoreDomainState, setNestedChild, toSet, toString, values
 
Methods inherited from class jopt.csp.spi.arcalgorithm.domain.AbstractDomain
addDomainChangeListener, addRangeChangeListener, addValueChangeListener, changed, removeDomainChangeListener, removeRangeChangeListener, removeValueChangeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jopt.csp.spi.arcalgorithm.domain.NumDomain
deltaValues, getDeltaSet, getSize, toSet, values
 
Methods inherited from interface jopt.csp.spi.arcalgorithm.domain.Domain
changed, clearDelta, clone, getDomainState, restoreDomainState
 
Methods inherited from interface jopt.csp.spi.solver.ChoicePointEntryListener
afterChoicePointPopEvent, afterChoicePointPushEvent, beforeChoicePointPopEvent, beforeChoicePointPushEvent
 
Methods inherited from interface jopt.csp.spi.solver.ChoicePointDataSource
choicePointStackSet, setChoicePointStack
 

Method Detail

getMax

public long getMax()
Returns maximum value of domain

Specified by:
getMax in interface LongDomain

getMin

public long getMin()
Returns minimum value of domain

Specified by:
getMin in interface LongDomain

isBound

public boolean isBound()
Returns true if domain is bound to a value

Specified by:
isBound in interface Domain

isInDomain

public boolean isInDomain(long val)
Returns true if value is in domain

Specified by:
isInDomain in interface LongDomain

setMax

public void setMax(long val)
            throws jopt.csp.variable.PropagationFailureException
Attempts to reduce domain to a maximum value.

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

setMin

public void setMin(long val)
            throws jopt.csp.variable.PropagationFailureException
Attempts to reduce domain to a minimum value.

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

setValue

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

Specified by:
setValue in interface LongDomain
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 the domain

Specified by:
removeValue in interface LongDomain
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 domain to within a range of values

Specified by:
setRange in interface LongDomain
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 domain by removing a range of values

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

setDomain

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

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

removeDomain

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

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

getNextHigher

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

Specified by:
getNextHigher in interface LongDomain

getNextLower

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

Specified by:
getNextLower in interface LongDomain

dump

public void dump()