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

java.lang.Object
  extended by uk.ac.ic.doc.automed.wrappers.AutoMedResult
Direct Known Subclasses:
SQLResult, YattaQueryResult

public class AutoMedResult
extends java.lang.Object

Provides a representation of the data associated with a scheme in an AutoMed Schema. This is modelled as a set or list of tuples. There is the notion of a cursor that points a particular tuple in the result set, and methods are provided to move the cursor through the tuples.

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

Constructor Summary
AutoMedResult(int nc)
          Create a new AutoMedResult with a fixed size of tuple in the resultCache
 
Method Summary
 boolean absolute(int rowNo)
           
 void addAutoMedTuple(AutoMedTuple t)
          Assert that a certain row number exists in a result
 int getAttributeType(int attributeNumber)
          Returns the type of an attribute in the tuple that the cursor currently points at.
 AutoMedTuple getAutoMedTuple()
          Return the tuple which the cursor current points at.
 AutoMedTuple getAutoMedTuple(int i)
          Move the cursor and get the tuple that is at the point
 boolean next()
          Returns true if the cursor can be moved to a next row
 boolean previous()
          Returns true if the cursor can be moved back to a previous row
 void rewind()
           
 java.lang.String toString()
          Produce a string representation of the result set, where {} indicates a set of values, and [] a list of values
 void toString(java.lang.StringBuffer r)
          Produce a string representation of the result set in a StringBuffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AutoMedResult

public AutoMedResult(int nc)
Create a new AutoMedResult with a fixed size of tuple in the resultCache

Method Detail

addAutoMedTuple

public void addAutoMedTuple(AutoMedTuple t)
Assert that a certain row number exists in a result


getAutoMedTuple

public AutoMedTuple getAutoMedTuple()
Return the tuple which the cursor current points at.


getAutoMedTuple

public AutoMedTuple getAutoMedTuple(int i)
Move the cursor and get the tuple that is at the point


getAttributeType

public int getAttributeType(int attributeNumber)
Returns the type of an attribute in the tuple that the cursor currently points at. Note that for most datasources, such as SQL databases, this will always return the same result regardless of which tuple the cursor currently points at.


toString

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

Overrides:
toString in class java.lang.Object

toString

public void toString(java.lang.StringBuffer r)
Produce a string representation of the result set in a StringBuffer.


previous

public boolean previous()
Returns true if the cursor can be moved back to a previous row


next

public boolean next()
Returns true if the cursor can be moved to a next row


absolute

public boolean absolute(int rowNo)

rewind

public void rewind()