fipaos.skill.constraint.ccl.variable
Class Tuple


public class Tuple


A tuple specifies sets of allowed combinations.

An example of a Tuple range would be:

(Savoy, London)



The values held in a Tuple may only be Strings.

Hence integers must be represented as follows: "1".


Constructor Summary
Tuple()
          Constructs an empty Tuple.
Tuple(String str)
          
Constructs a new Tuple and populates it with the values passed

in the String.
Tuple(Vector v)
          
Constructs a new Tuple and populates it with the values passed

in the Vector.

Method Summary
 voidaddValue(String str)
          
Adds another Value to the tuple.
 Tuplecopy()
          Returns an exact copy of this Tuple object.
 Enumerationelements()
          Returns an Enumeration of the elements held in this Tuple.
 static voidmain(String[] args)
          Used to test the class.
 StringtoString()
          Returns a String representation of this Tuple.

Constructor Detail

Tuple

public Tuple()
Constructs an empty Tuple.

Tuple

public Tuple(String str)

Constructs a new Tuple and populates it with the values passed

in the String. This should be a String representation of a tuple.

This String may take either of the following forms:



(house, car, boat)

house, car, boat



Hence brackets may or may not be present.

Tuple

public Tuple(Vector v)

Constructs a new Tuple and populates it with the values passed

in the Vector.

The Vector must contain String objects.
Method Detail

addValue

public void addValue(String str)

Adds another Value to the tuple.

copy

public Tuple copy()
Returns an exact copy of this Tuple object.

elements

public Enumeration elements()
Returns an Enumeration of the elements held in this Tuple.

main

public static void main(String[] args)
Used to test the class.

toString

public String toString()
Returns a String representation of this Tuple.

Association Links

to Class java.util.Vector


Vector to hold the values in this tuple.

This Vector should only ever contain String objects.