org.objectweb.medor.tuple.lib

Class ExplicitTupleCollection

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.

Constructor Summary

ExplicitTupleCollection()
ExplicitTupleCollection(TupleStructure schema)

Method Summary

Object
clone(Object clone, Map obj2clone)
void
close()
boolean
contains(Tuple T)
Some operations of researchs and iterations.
void
display()
void
first()
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
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()
int
getRow()
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
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()
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()
boolean
isLast()
Iterator
iteratorAll()
Iterator
iteratorOf(int i)
boolean
next()
boolean
previous()
void
removeTuple(int row)
Remove the tuple of the designated row number from the TupleCollection object
boolean
row(int row)
void
setBoolean(boolean x, int i)
void
setByte(byte x, int i)
void
setDate(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(String x, int i)
int
size()

Constructor Details

ExplicitTupleCollection

public ExplicitTupleCollection()


ExplicitTupleCollection

public ExplicitTupleCollection(TupleStructure schema)
            throws MedorException

Method Details

clone

public Object clone(Object clone,
                    Map obj2clone)
            throws CloneNotSupportedException


close

public void close()
            throws MedorException
Specified by:
close in interface TupleCollection


contains

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


display

public void display()
            throws MedorException


first

public void first()
            throws MedorException
Specified by:
first in interface TupleCollection


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


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


getDate

public 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


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


getMetaData

public TupleStructure getMetaData()
            throws MedorException
Specified by:
getMetaData in interface TupleCollection


getRow

public int getRow()
            throws MedorException
Specified by:
getRow in interface TupleCollection


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 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


getTuple

public Tuple getTuple()
            throws MedorException
Specified by:
getTuple in interface TupleCollection


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


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


isEmpty

public boolean isEmpty()
            throws MedorException
Specified by:
isEmpty in interface TupleCollection


isLast

public boolean isLast()
            throws MedorException
Specified by:
isLast in interface TupleCollection


iteratorAll

public Iterator iteratorAll()
            throws MedorException


iteratorOf

public Iterator iteratorOf(int i)
            throws MedorException


next

public boolean next()
            throws MedorException
Specified by:
next in interface TupleCollection


previous

public boolean previous()
            throws MedorException


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


row

public boolean row(int row)
            throws MedorException
Specified by:
row in interface TupleCollection


setBoolean

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


setByte

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


setDate

public void setDate(Date x,
                    int i)
            throws MedorException


setDouble

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


setFloat

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


setInt

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


setShort

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


setString

public void setString(String x,
                      int i)
            throws MedorException


size

public int size()