fipaos.skill.constraint.ccl.variable
Class CSPValue

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

public class CSPValue
extends java.lang.Object


This class describes the object CSP-value as described in the document
"CCL Language Specification v2.01" section 4.2.2.2, p12.

This object represents an option. In general this can be a tuple- hence
the variable is an ordered list of domain terms.

May contain the following information:

Npart integer 1
Elements List {domain-term} {blue, green, red}
Tags Set {symbol} {T1, T2}


Field Summary
static java.lang.String CSPVALUE
          Name CSPValue objects are labelled with when represented as Content objects.
static java.lang.String ELEMENTS
          
Used to reference the Element that contains the Value when represented as
a Content object.
static java.lang.String NAME
           
static java.lang.String NPART
          Name of the Attribute the Npart value is stored with when represented in Content objects.
static java.lang.String TAGS
           
static java.lang.String VALUE
          Name of the Attribute the Values contained in this class are stored as in Content objects.
 
Constructor Summary
CSPValue()
          Constructs an Empty CSPValue.
CSPValue(Content content)
          
Constructs a new CSPValue object and populates it using the Data held
in the passed Content object.
 
Method Summary
 void addElement(java.lang.String str)
          
Adds an Element to the CSPValue.
 void addTag(java.lang.String str)
          
Adds a Tag to the CSPValue.
 CSPValue copy()
          
Returns a copy of this CSPValue object.
 java.util.Vector getElements()
          
Returns a Vector of all the Elements held
 java.lang.String getElementString()
          
Returns a String representation of the collection of Elements
 int getNparts()
          
Returns the number of items in the Elements Parameter.
 java.util.Vector getTags()
          Retrieves the set of all the tags.
 java.lang.String getTagString()
          
Returns a String representation of the collection of Tags
If there are more than one will return them surrounded by brackets.
static void main(java.lang.String[] args)
          
Used for testing.
 Content toContent()
          Returns a Content object populated with the Data held in this CSPValue object.
 java.lang.String toString()
          
Returns a String representation of this CSPValue object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ELEMENTS

public static final java.lang.String ELEMENTS

Used to reference the Element that contains the Value when represented as
a Content object.

CSPVALUE

public static final java.lang.String CSPVALUE
Name CSPValue objects are labelled with when represented as Content objects.

NPART

public static final java.lang.String NPART
Name of the Attribute the Npart value is stored with when represented in Content objects.

VALUE

public static final java.lang.String VALUE
Name of the Attribute the Values contained in this class are stored as in Content objects.

TAGS

public static final java.lang.String TAGS

NAME

public static final java.lang.String NAME
Constructor Detail

CSPValue

public CSPValue()
Constructs an Empty CSPValue.

CSPValue

public CSPValue(Content content)

Constructs a new CSPValue object and populates it using the Data held
in the passed Content object.
Method Detail

addElement

public void addElement(java.lang.String str)

Adds an Element to the CSPValue.

getElements

public java.util.Vector getElements()

Returns a Vector of all the Elements held

getElementString

public java.lang.String getElementString()

Returns a String representation of the collection of Elements

addTag

public void addTag(java.lang.String str)

Adds a Tag to the CSPValue.

getTags

public java.util.Vector getTags()
Retrieves the set of all the tags.

getTagString

public java.lang.String getTagString()

Returns a String representation of the collection of Tags
If there are more than one will return them surrounded by brackets.

getNparts

public int getNparts()

Returns the number of items in the Elements Parameter.

copy

public CSPValue copy()

Returns a copy of this CSPValue object.

toString

public java.lang.String toString()

Returns a String representation of this CSPValue object.
Overrides:
toString in class java.lang.Object

toContent

public Content toContent()
Returns a Content object populated with the Data held in this CSPValue object.

main

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

Used for testing.