fipaos.skill.constraint.ccl.variable
Class CSPVariable

java.lang.Object
  |
  +--fipaos.skill.constraint.ccl.variable.CSPVariable

public class CSPVariable
extends java.lang.Object


This class describes the object CSP-variable as described in the document
"CCL Language Specification v2.01" section 4.2.2.4, p13.

This object represents a single choice to be made, along with a set of possible
options for that choice.
The Type and Role slots enable the Variable to be situated within the problem
solving context.


Field Summary
static java.lang.String CSPVARIABLE
          
Attribute name a CSPVariable is always referred to when represented as a
Content object.
static java.lang.String DOMAIN
          
Used to identify a Content object containing the values this variable may
take when the CSPVariable is represented as a Content object.
static java.lang.String NAME
          Used to identify a variable within a CSP when represented as a Content object.
static java.lang.String TYPE
          
Used to identify the type of variable this CSPVariable may contain when
represented as a Content object.
 
Constructor Summary
CSPVariable()
          Constucts an Empty CSPVariable.
CSPVariable(Content content)
          
Constructs a new CSPVariable and populates it using the values passed
in the Content object.
 
Method Summary
 void addType(java.lang.String str)
          
This specifies another type for the CSPVariable.
 void addValue(CSPValue value)
          Adds another the value to the list of values this object can take.
 CSPVariable copy()
          Produces a copy of a CSPVariable object.
 java.lang.String getName()
          Returns the name of the CSPVariable
 CSPRange getRange()
          
Retrieves the CSPRange value held in this variable.
 java.util.Vector getRoles()
          Returns a Vector of the roles that this CSPVariable may take.
 java.util.Vector getTypes()
          
This retrieves a Vector containing the types that this CSPVariable can take.
 java.util.Vector getValues()
          
Returns a Vector containing the possible values this Variable can take.
static void main(java.lang.String[] args)
          Used for testing.
 void setName(java.lang.String str)
          Sets of name for the CSPVariable
 void setRange(CSPRange range)
          
Sets a CSPRange object for the CSPVariable.
 void setRole(java.lang.String str)
          Adds another role.
 Content toContent()
          Returns a Content object populated using the Data held in this CSPVariable.
 java.lang.String toString()
          Produces a String representation of a CSPVariable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
Used to identify a variable within a CSP when represented as a Content object.

TYPE

public static final java.lang.String TYPE

Used to identify the type of variable this CSPVariable may contain when
represented as a Content object.

DOMAIN

public static final java.lang.String DOMAIN

Used to identify a Content object containing the values this variable may
take when the CSPVariable is represented as a Content object.

CSPVARIABLE

public static final java.lang.String CSPVARIABLE

Attribute name a CSPVariable is always referred to when represented as a
Content object.
Constructor Detail

CSPVariable

public CSPVariable()
Constucts an Empty CSPVariable.

CSPVariable

public CSPVariable(Content content)

Constructs a new CSPVariable and populates it using the values passed
in the Content object.
Method Detail

getValues

public java.util.Vector getValues()

Returns a Vector containing the possible values this Variable can take.

addValue

public void addValue(CSPValue value)
Adds another the value to the list of values this object can take.

getRoles

public java.util.Vector getRoles()
Returns a Vector of the roles that this CSPVariable may take.

setRole

public void setRole(java.lang.String str)
Adds another role.

getTypes

public java.util.Vector getTypes()

This retrieves a Vector containing the types that this CSPVariable can take.

addType

public void addType(java.lang.String str)

This specifies another type for the CSPVariable.
This specifies the type of values a CSPVariable can take.

getRange

public CSPRange getRange()

Retrieves the CSPRange value held in this variable.
This specifies the possible values this variable may take.

setRange

public void setRange(CSPRange range)

Sets a CSPRange object for the CSPVariable.
This specifies the possible values this variable may take.

getName

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

setName

public void setName(java.lang.String str)
Sets of name for the CSPVariable

copy

public CSPVariable copy()
Produces a copy of a CSPVariable object.

toString

public java.lang.String toString()
Produces a String representation of a CSPVariable.
Overrides:
toString in class java.lang.Object

toContent

public Content toContent()
Returns a Content object populated using the Data held in this CSPVariable.

main

public static void main(java.lang.String[] args)
Used for testing.