org.objectweb.medor.tuple.lib
Class ExplicitTupleCollection

java.lang.Object
  extended byBasicCloneable
      extended byorg.objectweb.medor.tuple.lib.ExplicitTupleCollection
All Implemented Interfaces:
TupleCollection

public class ExplicitTupleCollection
extends BasicCloneable
implements TupleCollection

This interface is an implementation of the TupleCollection interface using Java collections. It can be used when we have obejcts fetched in the memory.

See Also:
Serialized Form

Constructor Summary
ExplicitTupleCollection()
           
ExplicitTupleCollection(TupleStructure schema)
           
 
Method Summary
 java.lang.Object clone(java.lang.Object clone, java.util.Map obj2clone)
           
 void close()
          It closes the TupleCollection, relaeases used resources (example : ResultSet).
 boolean contains(Tuple T)
          Some operations of researchs and iterations.
 void display()
           
 void first()
          Moves the cursor to the first Tuple, row number 1.
 boolean getBoolean(int i)
          Returns the value of the designated column in the current row of this Tuple as a Boolean of java programming language
 byte getByte(int i)
          Returns the value of the designated column in the current row of this Tuple as a Byte of java programming language
 char getChar(int i)
          Returns the value of the designated column in the current row of this Tuple as a char of java programming language
 java.util.Date getDate(int i)
          Returns the value of the designated column in the current row of this Tuple as a java.util.Date of java programming language
 double getDouble(int i)
          Returns the value of the designated column in the current row of this Tuple as a double of java programming language
 float getFloat(int i)
          Returns the value of the designated column in the current row of this Tuple as a float of java programming language
 int getInt(int i)
          Returns the value of the designated column in the current row of this Tuple as an int of java programming language
 long getLong(int i)
          Returns the value of the designated column in the current row of this Tuple as a long of java programming language
 TupleStructure getMetaData()
          Retrieves the number,types and stors properties of the data sources of this TupleCollection Object.
 int getRow()
          Retrieves the current row Number.
 short getShort(int i)
          Returns the value of the designated column in the current row of this Tuple as a short of java programming language
 java.lang.String getString(int i)
          Returns the value of the designated column in the current row of this Tuple as a java.lang.String of java programming language
 Tuple getTuple()
          Returns the Tuple value of the current row of this TupleCollection object.
 Tuple getTuple(int i)
          Returns the value of the designated row number of the TupleCollection as a Tuple Object.
 void insertTuple(int i, Tuple T)
          Insert the tuple T at the designated row number of the TupleCollection
 void insertTuple(Tuple T)
          Insert the tuple T at the last of this TupleCollection object
 boolean isEmpty()
          Tell whether the current TupleCollection Object is empty or no.
 boolean isLast()
          Indicates whether the cursor is on the last row of this TupleCollection object.
 java.util.Iterator iteratorAll()
           
 java.util.Iterator iteratorOf(int i)
           
 boolean next()
          Moves the cursor down one row from its current position to the next tuple of this TupleCollection object.
 boolean previous()
           
 void removeTuple(int row)
          Remove the tuple of the designated row number from the TupleCollection object
 boolean row(int row)
          Moves the cursor to the given row number in this TupleCollection object.
 void setBoolean(boolean x, int i)
           
 void setByte(byte x, int i)
           
 void setDate(java.util.Date x, int i)
           
 void setDouble(double x, int i)
           
 void setFloat(float x, int i)
           
 void setInt(int x, int i)
           
 void setShort(short x, int i)
           
 void setString(java.lang.String x, int i)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExplicitTupleCollection

public ExplicitTupleCollection()

ExplicitTupleCollection

public ExplicitTupleCollection(TupleStructure schema)
                        throws MedorException
Method Detail

clone

public java.lang.Object clone(java.lang.Object clone,
                              java.util.Map obj2clone)
                       throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

close

public void close()
           throws MedorException
Description copied from interface: TupleCollection
It closes the TupleCollection, relaeases used resources (example : ResultSet). The next uses of the TupleCollection will throw an exception.

Specified by:
close in interface TupleCollection
Throws:
MedorException

getMetaData

public TupleStructure getMetaData()
                           throws MedorException
Description copied from interface: TupleCollection
Retrieves the number,types and stors properties of the data sources of this TupleCollection Object.

Specified by:
getMetaData in interface TupleCollection
Returns:
a TupleCollectionMetaData Object defining teh TupleCollection.
Throws:
MedorException - if a data source access error occurs

isEmpty

public boolean isEmpty()
                throws MedorException
Description copied from interface: TupleCollection
Tell whether the current TupleCollection Object is empty or no.

Specified by:
isEmpty in interface TupleCollection
Returns:
true if the TupleCollection is empty.
Throws:
MedorException - if data source access error.

isLast

public boolean isLast()
               throws MedorException
Description copied from interface: TupleCollection
Indicates whether the cursor is on the last row of this TupleCollection object.

Specified by:
isLast in interface TupleCollection
Returns:
true if the current Tuple is the last one or if the TupleCollection is Empty.
Throws:
MedorException - if data source access error

size

public int size()

next

public boolean next()
             throws MedorException
Description copied from interface: TupleCollection
Moves the cursor down one row from its current position to the next tuple of this TupleCollection object.

Specified by:
next in interface TupleCollection
Returns:
true if move is impossible and false if move is not performed.
Throws:
MedorException - if data source access error

previous

public boolean previous()
                 throws MedorException
Throws:
MedorException

row

public boolean row(int row)
            throws MedorException
Description copied from interface: TupleCollection
Moves the cursor to the given row number in this TupleCollection object. The first row is row 1, the second is row 2, and so on.

Specified by:
row in interface TupleCollection
Returns:
true if move is possible
Throws:
MedorException - if row number is invelid or data source access error

first

public void first()
           throws MedorException
Description copied from interface: TupleCollection
Moves the cursor to the first Tuple, row number 1.

Specified by:
first in interface TupleCollection
Throws:
MedorException - if data source access error

getRow

public int getRow()
           throws MedorException
Description copied from interface: TupleCollection
Retrieves the current row Number.

Specified by:
getRow in interface TupleCollection
Returns:
-1 if the iterator is out of bounds of the TupleCollection or if it is empty.
Throws:
MedorException - if data source access error.

insertTuple

public void insertTuple(int i,
                        Tuple T)
                 throws MedorException
Insert the tuple T at the designated row number of the TupleCollection

Parameters:
i - the first tuple is 1, the second is 2, ...
T - is the tuple to be inserted
Throws:
MedorException - if data source access error or invalid tuple number

insertTuple

public void insertTuple(Tuple T)
                 throws MedorException
Insert the tuple T at the last of this TupleCollection object

Parameters:
T - is the tuple to be inserted
Throws:
MedorException - if data source access error

removeTuple

public void removeTuple(int row)
                 throws MedorException
Remove the tuple of the designated row number from the TupleCollection object

Parameters:
row - the first tuple is 1, the second is 2, ...
Throws:
MedorException - if data source access error or invalid tuple number

getTuple

public Tuple getTuple(int i)
               throws MedorException
Returns the value of the designated row number of the TupleCollection as a Tuple Object.

Specified by:
getTuple in interface TupleCollection
Parameters:
i - the first tuple is 1, the second is 2, ...
Returns:
a Tuple Object
Throws:
MedorException - if data source access error

getTuple

public Tuple getTuple()
               throws MedorException
Description copied from interface: TupleCollection
Returns the Tuple value of the current row of this TupleCollection object.

Specified by:
getTuple in interface TupleCollection
Returns:
the value of the current Tuple.
Throws:
MedorException - if data source access error.

getBoolean

public boolean getBoolean(int i)
                   throws MedorException
Returns the value of the designated column in the current row of this Tuple as a Boolean of java programming language

Parameters:
i - the first column is 1, the second is 2, ...
Returns:
a boolean value
Throws:
MedorException - if data source access error or invalid cursor

getByte

public byte getByte(int i)
             throws MedorException
Returns the value of the designated column in the current row of this Tuple as a Byte of java programming language

Parameters:
i - the first column is 1, the second is 2, ...
Returns:
a byte value
Throws:
MedorException - if data source access error or invalid cursor

getDate

public java.util.Date getDate(int i)
                       throws MedorException
Returns the value of the designated column in the current row of this Tuple as a java.util.Date of java programming language

Parameters:
i - the first column is 1, the second is 2, ...
Returns:
a Date value as SQL type
Throws:
MedorException - if data source access error or invalid cursor

getDouble

public double getDouble(int i)
                 throws MedorException
Returns the value of the designated column in the current row of this Tuple as a double of java programming language

Parameters:
i - the first column is 1, the second is 2, ...
Returns:
a double value
Throws:
MedorException - if data source access error or invalid cursor

getFloat

public float getFloat(int i)
               throws MedorException
Returns the value of the designated column in the current row of this Tuple as a float of java programming language

Parameters:
i - the first column is 1, the second is 2, ...
Returns:
a float value
Throws:
MedorException - if data source access error or invalid cursor

getInt

public int getInt(int i)
           throws MedorException
Returns the value of the designated column in the current row of this Tuple as an int of java programming language

Parameters:
i - the first column is 1, the second is 2, ...
Returns:
an integer value
Throws:
MedorException - if data source access error or invalid cursor

getChar

public char getChar(int i)
             throws MedorException
Returns the value of the designated column in the current row of this Tuple as a char of java programming language

Parameters:
i - the first column is 1, the second is 2, ...
Returns:
a character value
Throws:
MedorException - if data source access error or invalid cursor

getLong

public long getLong(int i)
             throws MedorException
Returns the value of the designated column in the current row of this Tuple as a long of java programming language

Parameters:
i - the first column is 1, the second is 2, ...
Returns:
a long value
Throws:
MedorException - if data source access error or invalid cursor

getShort

public short getShort(int i)
               throws MedorException
Returns the value of the designated column in the current row of this Tuple as a short of java programming language

Parameters:
i - the first column is 1, the second is 2, ...
Returns:
a short value
Throws:
MedorException - if data source access error or invalid cursor

getString

public java.lang.String getString(int i)
                           throws MedorException
Returns the value of the designated column in the current row of this Tuple as a java.lang.String of java programming language

Parameters:
i - the first column is 1, the second is 2, ...
Returns:
a String value
Throws:
MedorException - if data source access error or invalid cursor

setBoolean

public void setBoolean(boolean x,
                       int i)
                throws MedorException
Throws:
MedorException

setByte

public void setByte(byte x,
                    int i)
             throws MedorException
Throws:
MedorException

setDate

public void setDate(java.util.Date x,
                    int i)
             throws MedorException
Throws:
MedorException

setDouble

public void setDouble(double x,
                      int i)
               throws MedorException
Throws:
MedorException

setFloat

public void setFloat(float x,
                     int i)
              throws MedorException
Throws:
MedorException

setInt

public void setInt(int x,
                   int i)
            throws MedorException
Throws:
MedorException

setShort

public void setShort(short x,
                     int i)
              throws MedorException
Throws:
MedorException

setString

public void setString(java.lang.String x,
                      int i)
               throws MedorException
Throws:
MedorException

contains

public boolean contains(Tuple T)
Some operations of researchs and iterations.


display

public void display()
             throws MedorException
Throws:
MedorException

iteratorOf

public java.util.Iterator iteratorOf(int i)
                              throws MedorException
Throws:
MedorException

iteratorAll

public java.util.Iterator iteratorAll()
                               throws MedorException
Throws:
MedorException