jopt.csp.variable
Interface CspGenericNumConstant

All Superinterfaces:
CspGenericConstant
All Known Subinterfaces:
CspGenericDoubleConstant, CspGenericFloatConstant, CspGenericIntConstant, CspGenericLongConstant

public interface CspGenericNumConstant
extends CspGenericConstant

Interface for CspGenericNumConstant objects

Author:
jboerkoel

Method Summary
 CspGenericNumConstant add(CspGenericNumConstant num)
          Creates a new GenericNumConstant representing this+num for each value of this and each associated value of the specified CspGenericNumConstant.
 CspGenericNumConstant add(java.lang.Number num)
          Creates a new GenericNumConstant representing this+num for each value of this.
 boolean contains(java.lang.Number num)
          Returns true if the given number is one of the constants contained in the generic constant
 CspGenericNumConstant createFragment(CspGenericIndex[] fragIndices)
          Returns a CspGenericNumConstant based on the specified indices
 CspGenericNumConstant divide(CspGenericNumConstant num)
          Creates a new GenericNumConstant representing num/this for each value of this and each associated value of the specified CspGenericNumConstant.
 CspGenericNumConstant divide(java.lang.Number num)
          Creates a new GenericNumConstant representing num/this for each value of this.
 CspGenericNumConstant divideBy(CspGenericNumConstant num)
          Creates a new GenericNumConstant representing this/num for each value of this and each associated value of the specified CspGenericNumConstant.
 CspGenericNumConstant divideBy(java.lang.Number num)
          Creates a new GenericNumConstant representing this/num for each value of this.
 CspGenericNumConstant divideByCeil(CspGenericNumConstant num)
          Creates a new GenericNumConstant representing ceil(this/num) for each value of this and each associated value of the specified CspGenericNumConstant.
 CspGenericNumConstant divideByCeil(java.lang.Number num)
          Creates a new GenericNumConstant representing ceil(this/num) for each value of this.
 CspGenericNumConstant divideByFloor(CspGenericNumConstant num)
          Creates a new GenericNumConstant representing floor(this/num) for each value of this and each associated value of the specified CspGenericNumConstant.
 CspGenericNumConstant divideByFloor(java.lang.Number num)
          Creates a new GenericNumConstant representing floor(this/num) for each value of this.
 CspGenericNumConstant divideCeil(CspGenericNumConstant num)
          Creates a new GenericNumConstant representing ceil(num/this) for each value of this and each associated value of the specified CspGenericNumConstant.
 CspGenericNumConstant divideCeil(java.lang.Number num)
          Creates a new GenericNumConstant representing ceil(num/this) for each value of this.
 CspGenericNumConstant divideFloor(CspGenericNumConstant num)
          Creates a new GenericNumConstant representing floor(num/this) for each value of this and each associated value of the specified CspGenericNumConstant.
 CspGenericNumConstant divideFloor(java.lang.Number num)
          Creates a new GenericNumConstant representing floor(num/this) for each value of this.
 java.lang.Number getNumber(int offset)
          Returns the constant at the specified offset as a Number object
 java.lang.Number getNumberForIndex()
          Returns the constant at the current index value as a Number object
 int getNumberType()
          Returns a value representing the type of constants this generic constant contains
 java.lang.Number[] getNumConstants()
          Returns all the constants wrapped by this generic constant as an array of Number objects
 java.lang.Number getNumMax()
          Returns the maximum value of all the constant values
 java.lang.Number getNumMin()
          Returns the minimal value of all the constant values
 CspGenericNumConstant multiply(CspGenericNumConstant num)
          Creates a new GenericNumConstant representing num*this for each value of this and each associated value of the specified CspGenericNumConstant.
 CspGenericNumConstant multiply(java.lang.Number num)
          Creates a new GenericNumConstant representing num*this for each value of this.
 CspGenericNumConstant subtract(CspGenericNumConstant num)
          Creates a new GenericNumConstant representing this-num for each value of this and each associated value of the specified CspGenericNumConstant.
 CspGenericNumConstant subtract(java.lang.Number num)
          Creates a new GenericNumConstant representing this-num for each value of this.
 CspGenericNumConstant subtractFrom(CspGenericNumConstant num)
          Creates a new GenericNumConstant representing num-this for each value of this and each associated value of the specified CspGenericNumConstant.
 CspGenericNumConstant subtractFrom(java.lang.Number num)
          Creates a new GenericNumConstant representing num-this for each value of this.
 
Methods inherited from interface jopt.csp.variable.CspGenericConstant
containsIndex, getConstantCount, getIndices, setIndicesToNodeOffset, toString
 

Method Detail

getNumberForIndex

public java.lang.Number getNumberForIndex()
Returns the constant at the current index value as a Number object

Returns:
Number object at the current index value

getNumberType

public int getNumberType()
Returns a value representing the type of constants this generic constant contains

Returns:
constant representing number type

getNumber

public java.lang.Number getNumber(int offset)
Returns the constant at the specified offset as a Number object

Parameters:
offset - index offset of which to obtain the number
Returns:
Number object at the index value offset

createFragment

public CspGenericNumConstant createFragment(CspGenericIndex[] fragIndices)
Returns a CspGenericNumConstant based on the specified indices

Parameters:
fragIndices - array of indices and values to fragment over
Returns:
generic num constant restricted to only the indice values in fragIndices

getNumConstants

public java.lang.Number[] getNumConstants()
Returns all the constants wrapped by this generic constant as an array of Number objects

Returns:
All number objects wrapped by this generic constant

contains

public boolean contains(java.lang.Number num)
Returns true if the given number is one of the constants contained in the generic constant

Parameters:
num - Number object to see if it is contained in the generic constants
Returns:
true if one of the generic constants is equivalent to num

getNumMin

public java.lang.Number getNumMin()
Returns the minimal value of all the constant values

Returns:
Number object representing the constant with the minimum value

getNumMax

public java.lang.Number getNumMax()
Returns the maximum value of all the constant values

Returns:
Number object representing the constant with the maximum value

add

public CspGenericNumConstant add(java.lang.Number num)
Creates a new GenericNumConstant representing this+num for each value of this.

Parameters:
num - Number constant to add to this constant
Returns:
generic constant representing this + num

add

public CspGenericNumConstant add(CspGenericNumConstant num)
Creates a new GenericNumConstant representing this+num for each value of this and each associated value of the specified CspGenericNumConstant.

Parameters:
num - generic number constant to add to this constant
Returns:
generic constant representing this + num

subtractFrom

public CspGenericNumConstant subtractFrom(java.lang.Number num)
Creates a new GenericNumConstant representing num-this for each value of this.

Parameters:
num - number constant to subtract this constant from
Returns:
generic constant representing num - this

subtractFrom

public CspGenericNumConstant subtractFrom(CspGenericNumConstant num)
Creates a new GenericNumConstant representing num-this for each value of this and each associated value of the specified CspGenericNumConstant.

Parameters:
num - generic number constant to subtract this constant from
Returns:
generic constant representing num - this

subtract

public CspGenericNumConstant subtract(java.lang.Number num)
Creates a new GenericNumConstant representing this-num for each value of this.

Parameters:
num - number constant to subtract from this constant
Returns:
generic constant representing this-num

subtract

public CspGenericNumConstant subtract(CspGenericNumConstant num)
Creates a new GenericNumConstant representing this-num for each value of this and each associated value of the specified CspGenericNumConstant.

Parameters:
num - generic number constant to subtract from this constant
Returns:
generic constant representing this-num

multiply

public CspGenericNumConstant multiply(java.lang.Number num)
Creates a new GenericNumConstant representing num*this for each value of this.

Parameters:
num - number constant to multiply by this constant
Returns:
generic constant representing this*num

multiply

public CspGenericNumConstant multiply(CspGenericNumConstant num)
Creates a new GenericNumConstant representing num*this for each value of this and each associated value of the specified CspGenericNumConstant.

Parameters:
num - generic number constant to multiply by this constant
Returns:
generic constant representing this*num

divideByCeil

public CspGenericNumConstant divideByCeil(java.lang.Number num)
Creates a new GenericNumConstant representing ceil(this/num) for each value of this.

Parameters:
num - number constant to divide this constant by
Returns:
generic constant representing ceil[this/num]

divideByCeil

public CspGenericNumConstant divideByCeil(CspGenericNumConstant num)
Creates a new GenericNumConstant representing ceil(this/num) for each value of this and each associated value of the specified CspGenericNumConstant.

Parameters:
num - generic number constant to divide this constant by
Returns:
generic constant representing ceil[this/num]

divideByFloor

public CspGenericNumConstant divideByFloor(java.lang.Number num)
Creates a new GenericNumConstant representing floor(this/num) for each value of this.

Parameters:
num - number constant to divide this constant by
Returns:
generic constant representing floor[this/num]

divideByFloor

public CspGenericNumConstant divideByFloor(CspGenericNumConstant num)
Creates a new GenericNumConstant representing floor(this/num) for each value of this and each associated value of the specified CspGenericNumConstant.

Parameters:
num - generic number constant to divide this constant by
Returns:
generic constant representing floor[this/num]

divideBy

public CspGenericNumConstant divideBy(java.lang.Number num)
Creates a new GenericNumConstant representing this/num for each value of this.

Parameters:
num - generic number constant to divide this constant by
Returns:
generic constant representing this/num

divideBy

public CspGenericNumConstant divideBy(CspGenericNumConstant num)
Creates a new GenericNumConstant representing this/num for each value of this and each associated value of the specified CspGenericNumConstant.

Parameters:
num - generic number constant to divide this constant by
Returns:
generic constant representing this/num

divide

public CspGenericNumConstant divide(java.lang.Number num)
Creates a new GenericNumConstant representing num/this for each value of this.

Parameters:
num - number constant to divide by this constant
Returns:
generic constant representing num/this

divide

public CspGenericNumConstant divide(CspGenericNumConstant num)
Creates a new GenericNumConstant representing num/this for each value of this and each associated value of the specified CspGenericNumConstant.

Parameters:
num - generic number constant to divide by this constant
Returns:
generic constant representing num/this

divideCeil

public CspGenericNumConstant divideCeil(java.lang.Number num)
Creates a new GenericNumConstant representing ceil(num/this) for each value of this.

Parameters:
num - number constant to divide by this constant
Returns:
generic constant representing ceil[num/this]

divideCeil

public CspGenericNumConstant divideCeil(CspGenericNumConstant num)
Creates a new GenericNumConstant representing ceil(num/this) for each value of this and each associated value of the specified CspGenericNumConstant.

Parameters:
num - generic number constant to divide by this constant
Returns:
generic constant representing ceil[num/this]

divideFloor

public CspGenericNumConstant divideFloor(java.lang.Number num)
Creates a new GenericNumConstant representing floor(num/this) for each value of this.

Parameters:
num - number constant to divide by this constant
Returns:
generic constant representing floor[num/this]

divideFloor

public CspGenericNumConstant divideFloor(CspGenericNumConstant num)
Creates a new GenericNumConstant representing floor(num/this) for each value of this and each associated value of the specified CspGenericNumConstant.

Parameters:
num - generic number constant to divide by this constant
Returns:
generic constant representing floor[num/this]