uk.ac.ic.doc.automed.wrappers
Class AutoMedTuple

java.lang.Object
  |
  +--uk.ac.ic.doc.automed.wrappers.AutoMedType
        |
        +--uk.ac.ic.doc.automed.wrappers.AutoMedTuple

public class AutoMedTuple
extends AutoMedType

A structure to hold one tuple of data, to be used by AutoMedResult as the basis for storing sets, lists or bags of tuples.

Author:
Peter McBrien (pjm@doc.ic.ac.uk)

Field Summary
 
Fields inherited from class uk.ac.ic.doc.automed.wrappers.AutoMedType
BOOLEAN, FLOAT, INTEGER, STRING, TIME, TUPLE
 
Constructor Summary
AutoMedTuple(AutoMedResult amr, int i, int nc)
          Create a new tuple belonging to row i and with nc attributes
 
Method Summary
 boolean equals(AutoMedType v)
          Test two AutoMedTypes for equality, performing conversions as appropriate.
 AutoMedType getAttribute(int no)
          Return a particular attribute from a tuple (counting from one)
 int getAttributeType(int attributeNumber)
           
 AutoMedType[] getData()
          Return all the attributes of this tuple as an array
 int getInt(int i)
          Return a particular attribute from a tuple (counting from one) as a 32 bit integer
 java.lang.String getString(int i)
          Return a particular attribute from a tuple (counting from one) as a String
 int getType()
          Return the Type (INTEGER, TUPLE, ...) of this AutoMedType
 void setAttribute(int no, AutoMedType v)
          Set the value of a certain field
 int size()
           
 java.lang.String toString()
          Produce a string representation of the AutoMedTuple
 void toString(java.lang.StringBuffer r)
          Produce a string representation of the result set, where {} indicates a set of values, and [] a list of values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AutoMedTuple

public AutoMedTuple(AutoMedResult amr,
                    int i,
                    int nc)
Create a new tuple belonging to row i and with nc attributes

Method Detail

setAttribute

public void setAttribute(int no,
                         AutoMedType v)
                  throws DataSourceException
Set the value of a certain field

DataSourceException

size

public int size()

getData

public AutoMedType[] getData()
Return all the attributes of this tuple as an array


getAttribute

public AutoMedType getAttribute(int no)
                         throws DataSourceException
Return a particular attribute from a tuple (counting from one)

DataSourceException

getString

public java.lang.String getString(int i)
Return a particular attribute from a tuple (counting from one) as a String


getInt

public int getInt(int i)
           throws DataSourceException
Return a particular attribute from a tuple (counting from one) as a 32 bit integer

DataSourceException

toString

public void toString(java.lang.StringBuffer r)
Produce a string representation of the result set, where {} indicates a set of values, and [] a list of values


toString

public java.lang.String toString()
Produce a string representation of the AutoMedTuple

Specified by:
toString in class AutoMedType

getAttributeType

public int getAttributeType(int attributeNumber)

equals

public boolean equals(AutoMedType v)
Description copied from class: AutoMedType
Test two AutoMedTypes for equality, performing conversions as appropriate.

Specified by:
equals in class AutoMedType

getType

public final int getType()
Description copied from class: AutoMedType
Return the Type (INTEGER, TUPLE, ...) of this AutoMedType

Specified by:
getType in class AutoMedType