jopt.csp.spi.util
Class GenericIndex

java.lang.Object
  extended byjopt.csp.spi.util.GenericIndex
All Implemented Interfaces:
jopt.csp.variable.CspGenericIndex

public class GenericIndex
extends java.lang.Object
implements jopt.csp.variable.CspGenericIndex

Represents subscript for a generic variable, such as i for Xi + Yi > Zi.


Constructor Summary
GenericIndex(java.lang.String name, int size)
           
 
Method Summary
 void changeVal(int v)
          Sets the current value of the index
 int currentVal()
          Returns the current numeric value of the index
 boolean equals(java.lang.Object obj)
           
 java.lang.String getName()
          Returns the name of this index
 int hashCode()
           
 boolean hasNext()
          Move the index to the next value
 boolean next()
          Move the index to the next value
 void reset()
          Resets index to initial value
 void setName(java.lang.String name)
          Sets the name of this index
 int size()
          Returns the size of the index
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GenericIndex

public GenericIndex(java.lang.String name,
                    int size)
Method Detail

setName

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


getName

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

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

reset

public void reset()
Resets index to initial value


next

public boolean next()
Move the index to the next value


hasNext

public boolean hasNext()
Move the index to the next value


size

public int size()
Returns the size of the index

Specified by:
size in interface jopt.csp.variable.CspGenericIndex

currentVal

public int currentVal()
Returns the current numeric value of the index

Specified by:
currentVal in interface jopt.csp.variable.CspGenericIndex

changeVal

public void changeVal(int v)
Sets the current value of the index

Specified by:
changeVal in interface jopt.csp.variable.CspGenericIndex

hashCode

public int hashCode()

equals

public final boolean equals(java.lang.Object obj)

toString

public java.lang.String toString()