org.gibello.zql.data
Class ZTuple

java.lang.Object
  extended by org.gibello.zql.data.ZTuple

public class ZTuple
extends java.lang.Object


Constructor Summary
ZTuple()
          The simplest constructor
ZTuple(java.lang.String colnames)
          Create a new tuple, given it's column names
 
Method Summary
 int getAttIndex(java.lang.String name)
          Return the index of the attribute corresponding to the name
 java.lang.String getAttName(int index)
          Return the name of the attribute corresponding to the index
 java.lang.Object getAttValue(int index)
          Return the value of the attribute corresponding to the index
 java.lang.Object getAttValue(java.lang.String name)
          Return the value of the attribute whith the given name
 int getNumAtt()
          Return the number of attributes in the tupple
 boolean isAttribute(java.lang.String attrName)
          To know if an attributes is already defined
 void setAtt(java.lang.String name, java.lang.Object value)
          Set the value of the given attribute name
 void setRow(java.lang.String row)
          Set the current tuple's column values.
 void setRow(java.util.Vector row)
          Set the current tuple's column values.
 java.lang.String toString()
          Returns a string representation of the object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ZTuple

public ZTuple()
The simplest constructor


ZTuple

public ZTuple(java.lang.String colnames)
Create a new tuple, given it's column names

Parameters:
colnames - Column names separated by commas (,).
Method Detail

setRow

public void setRow(java.lang.String row)
Set the current tuple's column values.

Parameters:
row - Column values separated by commas (,).

setRow

public void setRow(java.util.Vector row)
Set the current tuple's column values.

Parameters:
row - A vector of column values.

setAtt

public void setAtt(java.lang.String name,
                   java.lang.Object value)
Set the value of the given attribute name

Parameters:
name - the string representing the attribute name
value - the Object representing the attribute value

getAttName

public java.lang.String getAttName(int index)
Return the name of the attribute corresponding to the index

Parameters:
index - integer giving the index of the attribute
Returns:
a String

getAttIndex

public int getAttIndex(java.lang.String name)
Return the index of the attribute corresponding to the name

Parameters:
index - integer giving the index of the attribute
Returns:
the index as an int, -1 if name is not an attribute

getAttValue

public java.lang.Object getAttValue(int index)
Return the value of the attribute corresponding to the index

Parameters:
index - integer giving the index of the attribute
Returns:
an Object (null if index is out of bound)

getAttValue

public java.lang.Object getAttValue(java.lang.String name)
Return the value of the attribute whith the given name

Returns:
an Object (null if name is not an existing attribute)

isAttribute

public boolean isAttribute(java.lang.String attrName)
To know if an attributes is already defined

Parameters:
attrName - the name of the attribute
Returns:
true if there, else false

getNumAtt

public int getNumAtt()
Return the number of attributes in the tupple

Returns:
int the number of attributes

toString

public java.lang.String toString()
Returns a string representation of the object

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object