cartago
Class Tuple

java.lang.Object
  extended by cartago.Tuple
All Implemented Interfaces:
java.io.Serializable

public class Tuple
extends java.lang.Object
implements java.io.Serializable

Basic tuple data type.

Author:
aricci
See Also:
Serialized Form

Field Summary
static java.lang.Object ANY
           
static java.lang.Object UNKNOWN
           
 
Constructor Summary
Tuple(java.lang.Object[] objs)
           
Tuple(java.lang.String name)
           
Tuple(java.lang.String name, java.lang.Object... objs)
           
 
Method Summary
 boolean booleanContent(int index)
          Get the i-th argument coverted to a boolean
 double doubleContent(int index)
          Get the i-th argument coverted to an double
 java.lang.Object getContent(int index)
          Get the i-th argument of the tuple.
 java.lang.Object[] getContents()
          Get the full array of arguments.
 java.lang.String getLabel()
          Get the label of the tuple.
 int getNArgs()
          Get the arity of the tuple.
 int intContent(int index)
          Get the i-th argument coverted to an integer
 java.lang.String stringContent(int index)
          Get the i-th argument coverted to a String
 java.lang.String toString()
          Get the string representation of the tuple.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ANY

public static final java.lang.Object ANY

UNKNOWN

public static final java.lang.Object UNKNOWN
Constructor Detail

Tuple

public Tuple(java.lang.String name)

Tuple

public Tuple(java.lang.String name,
             java.lang.Object... objs)

Tuple

public Tuple(java.lang.Object[] objs)
Method Detail

getLabel

public java.lang.String getLabel()
Get the label of the tuple.

Returns:

getContent

public java.lang.Object getContent(int index)
Get the i-th argument of the tuple.

Parameters:
index - index of the argument
Returns:

getContents

public java.lang.Object[] getContents()
Get the full array of arguments.

Returns:

intContent

public int intContent(int index)
Get the i-th argument coverted to an integer

Parameters:
index -
Returns:

doubleContent

public double doubleContent(int index)
Get the i-th argument coverted to an double

Parameters:
index -
Returns:

booleanContent

public boolean booleanContent(int index)
Get the i-th argument coverted to a boolean

Parameters:
index -
Returns:

stringContent

public java.lang.String stringContent(int index)
Get the i-th argument coverted to a String

Parameters:
index -
Returns:

getNArgs

public int getNArgs()
Get the arity of the tuple.

Returns:

toString

public java.lang.String toString()
Get the string representation of the tuple. TupleName(TupleArg,...)

Overrides:
toString in class java.lang.Object


>DEIS - University of Bologna