fipaos.skill.constraint.ccl.variable
Class CSPRange


public class CSPRange


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
 final static StringCSPRANGE
          Name a CSPRange is labelled with when represented as a Content object.
 final static StringLIST_RANGE
          Name of the Element where the range of values a CSPRange may take are listed.
 final static StringRANGE
           
 final static StringVALUES
          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
 voidaddRange(String str)
          
Adds a domain range to the CSPRange.
 voidaddRange(Vector range)
          
Adds a domain range to the CSPRange.
 voidaddTuple(Tuple tuple)
          
Adds a Tuple to the CSPRange.
 CSPRangecopy()
          Returns a copy of this CSPRange object.
 VectorgetRange()
          
Returns a Vector of the Strings that comprise the Range

Value held in the CSPRange.
 StringgetRangeType()
          Return the type of values that may be held in this CSPRange object.
 VectorgetTuples()
          
Returns a Vector of Tuple objects.
 static voidmain(String[] args)
          
Used for testing.
 voidsetRangeType(String str)
          Sets the type of values that are held in this CSPRange object.
 ContenttoContent()
          
Creates a new Content object populates it with the Values

held in this class then returns it.
 StringtoString()
          
Returns a String representation of a CSPRange.

Field Detail

CSPRANGE

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

LIST_RANGE

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

RANGE

public final static String RANGE

VALUES

public final static String VALUES
Name of the Attribute where the values are listed.
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(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(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.

copy

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

getRange

public Vector getRange()

Returns a Vector of the Strings that comprise the Range

Value held in the CSPRange.

getRangeType

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

getTuples

public Vector getTuples()

Returns a Vector of Tuple objects.

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

main

public static void main(String[] args)

Used for testing.


setRangeType

public void setRangeType(String str)
Sets the type of values that are 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.

toString

public String toString()

Returns a String representation of a CSPRange.

Association Links

to Class java.lang.String

to Class java.lang.String

Name of the Element where the range of values a CSPRange may take are listed.

to Class java.lang.String

Name of the Attribute where the values are listed.

to Class java.lang.String

Name a CSPRange is labelled with when represented as a Content object.

to Class java.util.Vector


Range.

This variable defines complete domains such as ordered lists of numbers,

world airports, etc. These must be part of a common ontology.



An example of a range would be {car, boat, plane}

to Class java.lang.String

Contains a Reference to the type of Objects this Range contains.

to Class java.util.Vector


Tuple-range

This variable defines a combination of all the legal values in a tuple

A range is given for each slot in the tuple and this parameter specifies

that all combinations of values from the given ranges in each slot in

the tuple are legal.

A tuple specifies sets of allowed combinations.



An example of a Tuple range would be:

{(Savoy, London), (Hyatt, Singapore), (Waldorf, NewYork)}