Cream version 1.2 Core API Specification

jp.ac.kobe_u.cs.cream
Class Variable

java.lang.Object
  extended byjp.ac.kobe_u.cs.cream.Variable
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
IntVariable

public class Variable
extends java.lang.Object
implements java.lang.Cloneable

Variables. A variable is a component of a constraint network. A variable is constructed with an initial domain which specifies the set of elements over which the variable ranges. See Network for example programs to construct variables and add them to a constraint network.

Since:
1.0
See Also:
Network, Domain

Constructor Summary
Variable(Network net, Domain d)
          Constructs a variable of the network with an initial domain d and a default name.
Variable(Network net, Domain d, java.lang.String name)
          Constructs a variable of the network with an initial domain d and a name specified by the parameter name.
 
Method Summary
 java.lang.String getName()
          Returns the name of this variable.
 java.lang.String toString()
          Returns the name of this variable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Variable

public Variable(Network net,
                Domain d)
Constructs a variable of the network with an initial domain d and a default name. This constructor is equivalent to Variable(network, d, null).

Parameters:
net - the network
d - the initial domain

Variable

public Variable(Network net,
                Domain d,
                java.lang.String name)
Constructs a variable of the network with an initial domain d and a name specified by the parameter name. When the parameter name is null, default names (v1, v2, and so on) are used.

Parameters:
net - the network
d - the initial domain
name - the name of the variable, or null for a default name
Method Detail

getName

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

Returns:
the name of this variable

toString

public java.lang.String toString()
Returns the name of this variable.

Returns:
the name of this variable

Cream version 1.2 Core API Specification

Cream: Constraint Programming Class Library for Java