jopt.csp.spi.arcalgorithm.variable
Class GenericFloatConstant

java.lang.Object
  extended byjopt.csp.spi.arcalgorithm.variable.GenericNumConstant
      extended byjopt.csp.spi.arcalgorithm.variable.GenericFloatConstant
All Implemented Interfaces:
jopt.csp.variable.CspGenericConstant, jopt.csp.variable.CspGenericFloatConstant, jopt.csp.variable.CspGenericNumConstant, GenericConstant

public class GenericFloatConstant
extends GenericNumConstant
implements jopt.csp.variable.CspGenericFloatConstant

A generic float constant such as Xi representing 1.1, 7.3, and 12.8 for i=0, i=1, and i=2, respectively


Constructor Summary
GenericFloatConstant(java.lang.String name, jopt.csp.variable.CspGenericIndex[] indices, float[] vals)
          Constructor
GenericFloatConstant(java.lang.String name, jopt.csp.variable.CspGenericIndex[] indices, java.lang.Float[] vals)
          Constructor
 
Method Summary
 GenericNumConstant generateNumConstant(java.lang.Number num)
          Generates a GenericNumConstant based on only one number
 GenericNumConstant generateNumConstant(java.lang.String name, jopt.csp.variable.CspGenericIndex[] indices, java.lang.Number[] vals)
          Create a new GenericNumConstant with the given indices and constant values
 java.lang.Float[] getFloatConstants()
           
 java.lang.Float getFloatForIndex()
           
 java.lang.Float getMax()
           
 java.lang.Float getMin()
           
 int getNumberType()
           
 java.lang.String toString()
          Displays name of node along with indices
 
Methods inherited from class jopt.csp.spi.arcalgorithm.variable.GenericNumConstant
add, add, contains, containsIndex, createFragment, divide, divide, divideBy, divideBy, divideByCeil, divideByCeil, divideByFloor, divideByFloor, divideCeil, divideCeil, divideFloor, divideFloor, getConstantCount, getIndices, getNumber, getNumberForIndex, getNumConstants, getNumMax, getNumMin, multiply, multiply, setIndicesToNodeOffset, subtract, subtract, subtractFrom, subtractFrom
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jopt.csp.variable.CspGenericNumConstant
add, add, contains, createFragment, divide, divide, divideBy, divideBy, divideByCeil, divideByCeil, divideByFloor, divideByFloor, divideCeil, divideCeil, divideFloor, divideFloor, getNumber, getNumberForIndex, getNumConstants, getNumMax, getNumMin, multiply, multiply, subtract, subtract, subtractFrom, subtractFrom
 
Methods inherited from interface jopt.csp.variable.CspGenericConstant
containsIndex, getConstantCount, getIndices, setIndicesToNodeOffset
 

Constructor Detail

GenericFloatConstant

public GenericFloatConstant(java.lang.String name,
                            jopt.csp.variable.CspGenericIndex[] indices,
                            java.lang.Float[] vals)
Constructor

Parameters:
name - unique name of this node
indices - array of indices that generic node is based upon
vals - array of vals that this generic constant wraps

GenericFloatConstant

public GenericFloatConstant(java.lang.String name,
                            jopt.csp.variable.CspGenericIndex[] indices,
                            float[] vals)
Constructor

Parameters:
name - unique name of this node
indices - array of indices that generic node is based upon
vals - array of vals that this generic constant wraps
Method Detail

generateNumConstant

public GenericNumConstant generateNumConstant(java.lang.Number num)
Description copied from class: GenericNumConstant
Generates a GenericNumConstant based on only one number

Specified by:
generateNumConstant in class GenericNumConstant
Parameters:
num - number to base singly indexed constant on
Returns:
a generic num constant that has a single value

generateNumConstant

public GenericNumConstant generateNumConstant(java.lang.String name,
                                              jopt.csp.variable.CspGenericIndex[] indices,
                                              java.lang.Number[] vals)
Description copied from class: GenericNumConstant
Create a new GenericNumConstant with the given indices and constant values

Specified by:
generateNumConstant in class GenericNumConstant
Parameters:
name - Name of the new generic constant
indices - Indices on which the generic constant is based
vals - Array of constant values that the generic constant will wrap
Returns:
A new CspGenericNumConstant created according to the specified parameters

getFloatForIndex

public java.lang.Float getFloatForIndex()
Specified by:
getFloatForIndex in interface jopt.csp.variable.CspGenericFloatConstant

getNumberType

public int getNumberType()
Specified by:
getNumberType in interface jopt.csp.variable.CspGenericNumConstant

getFloatConstants

public java.lang.Float[] getFloatConstants()
Specified by:
getFloatConstants in interface jopt.csp.variable.CspGenericFloatConstant

getMin

public java.lang.Float getMin()
Specified by:
getMin in interface jopt.csp.variable.CspGenericFloatConstant

getMax

public java.lang.Float getMax()
Specified by:
getMax in interface jopt.csp.variable.CspGenericFloatConstant

toString

public java.lang.String toString()
Description copied from class: GenericNumConstant
Displays name of node along with indices

Specified by:
toString in interface jopt.csp.variable.CspGenericConstant
Specified by:
toString in class GenericNumConstant