javax.constraints
Interface VarString

All Superinterfaces:
ConstrainedVariable
All Known Implementing Classes:
BasicVarString

public interface VarString
extends ConstrainedVariable

VarString are a special type of constrained variables that are defined using an array of string values.


Method Summary
 java.lang.String[] getAllStrings()
          Returns all possible strings from the domain of this variable.
 int getIndex(java.lang.String string)
           
 java.lang.String getInitialDomain()
           
 Var getInt()
          Returns the underlying integer constrained variable.
 java.lang.String getValue()
          Returns a String which is the value to which this variable has been instantiated, throws a RuntimeException if the variable is not instantiated.
 boolean hasSameDomain(VarString var)
           
 boolean isBound()
           
 
Methods inherited from interface javax.constraints.ConstrainedVariable
getImpl, getName, getObject, getProblem, setImpl, setName, setObject
 

Method Detail

getAllStrings

java.lang.String[] getAllStrings()
Returns all possible strings from the domain of this variable.

Returns:
all possible strings from the domain of this variable.

getIndex

int getIndex(java.lang.String string)
Parameters:
string -
Returns:
an integer index of the "string" inside the domain of this variable.

getInitialDomain

java.lang.String getInitialDomain()
Returns:
a string representing the initial domain of the variable

getInt

Var getInt()
Returns the underlying integer constrained variable.

Returns:
the underlying integer constrained variable.

getValue

java.lang.String getValue()
Returns a String which is the value to which this variable has been instantiated, throws a RuntimeException if the variable is not instantiated.

Returns:
a String which is the value of this instantiated variable.
Throws:
java.lang.RuntimeException - if this variable is not instantiated.

hasSameDomain

boolean hasSameDomain(VarString var)
Parameters:
var -
Returns:
true if this variable has the same domain as "var"

isBound

boolean isBound()
Returns:
true if the variable is bound (domain size is 1)