fipaos.skill.constraint.ccl.variable
Class CSPRange

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

public class CSPRange
extends java.lang.Object


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

This object represents a complete domain, to be used when explicit
enumeration of values would be too inefficient. the two items "Range"
and "Tuple-range" are optional however one or the other must be present.


Field Summary
static java.lang.String CSPRANGE
          Name a CSPRange is labelled with when represented as a Content object.
static java.lang.String LIST_RANGE
          Name of the Element where the range of values a CSPRange may take are listed.
static java.lang.String RANGE
           
static java.lang.String VALUES
          Name of the Attribute where the values are listed.
 
Constructor Summary
CSPRange()
          
Creates an empty CSPRange object.
CSPRange(Content content)
          
Constructs a new CSPRange object.
 
Method Summary
 void addRange(java.lang.String str)
          
Adds a domain range to the CSPRange.
 void addRange(java.util.Vector range)
          
Adds a domain range to the CSPRange.
 void addTuple(Tuple tuple)
          
Adds a Tuple to the CSPRange.
 CSPRange copy()
          Returns a copy of this CSPRange object.
 java.util.Vector getRange()
          
Returns a Vector of the Strings that comprise the Range
Value held in the CSPRange.
 java.lang.String getRangeType()
          Return the type of values that may be held in this CSPRange object.
 java.util.Vector getTuples()
          
Returns a Vector of Tuple objects.
static void main(java.lang.String[] args)
          
Used for testing.
 void setRangeType(java.lang.String str)
          Sets the type of values that are held in this CSPRange object.
 Content toContent()
          
Creates a new Content object populates it with the Values
held in this class then returns it.
 java.lang.String toString()
          
Returns a String representation of a CSPRange.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RANGE

public static final java.lang.String RANGE

LIST_RANGE

public static final java.lang.String LIST_RANGE
Name of the Element where the range of values a CSPRange may take are listed.

VALUES

public static final java.lang.String VALUES
Name of the Attribute where the values are listed.

CSPRANGE

public static final java.lang.String CSPRANGE
Name a CSPRange is labelled with when represented as a Content object.
Constructor Detail

CSPRange

public CSPRange()

Creates an empty CSPRange object.

CSPRange

public CSPRange(Content content)

Constructs a new CSPRange object.
Populates it using the Data held in the passed Content object.
Method Detail

addRange

public void addRange(java.lang.String str)

Adds a domain range to the CSPRange.
The String representing this range should take the following form:
{house, car, boat}

addRange

public void addRange(java.util.Vector range)

Adds a domain range to the CSPRange.
The Vector should contain the Strings that comprise the Range.

addTuple

public void addTuple(Tuple tuple)

Adds a Tuple to the CSPRange.

getRange

public java.util.Vector getRange()

Returns a Vector of the Strings that comprise the Range
Value held in the CSPRange.

getTuples

public java.util.Vector getTuples()

Returns a Vector of Tuple objects.
This is a copy of the Vector of Tuple objects held in the CSPRange object.

copy

public CSPRange copy()
Returns a copy of this CSPRange object.

toString

public java.lang.String toString()

Returns a String representation of a CSPRange.
Overrides:
toString in class java.lang.Object

setRangeType

public void setRangeType(java.lang.String str)
Sets the type of values that are held in this CSPRange object.

getRangeType

public java.lang.String getRangeType()
Return the type of values that may be held in this CSPRange object.

toContent

public Content toContent()

Creates a new Content object populates it with the Values
held in this class then returns it.

main

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

Used for testing.