|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.org.ogsadai.tuple.SimpleTuple
public class SimpleTuple
The implementation of the Tuple interface.
| Field Summary | |
|---|---|
protected java.util.List |
mElements
The List containing the elements of the tuple. |
protected Null |
mODNULL
SQL NULL representation. |
protected boolean |
mWasNull
Checks whether the last column value was null or not. |
| Constructor Summary | |
|---|---|
protected |
SimpleTuple()
|
|
SimpleTuple(java.util.List elements)
Constructor of the tuple object. |
|
SimpleTuple(Tuple tupleA,
Tuple tupleB)
Constructs a new tuple by joining two given tuples. |
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
|
java.math.BigDecimal |
getBigDecimal(int columnIndex)
Gets the value of the specified column as a BigDecimal. |
java.math.BigDecimal |
getBigDecimal(TupleMetadata metadata,
java.lang.String columnName)
Gets the value of the specified column as a BigDecimal. |
java.sql.Blob |
getBlob(int columnIndex)
Gets the value of the specified column as an Blob. |
java.sql.Blob |
getBlob(TupleMetadata metadata,
java.lang.String columnName)
Gets the value of the specified column as a Blob. |
boolean |
getBoolean(int columnIndex)
Gets the value of the specified column as a boolean. |
boolean |
getBoolean(TupleMetadata metadata,
java.lang.String columnName)
Gets the value of the specified column as a boolean. |
char |
getChar(int columnIndex)
Gets the value of the specified column as a char. |
char |
getChar(TupleMetadata metadata,
java.lang.String columnName)
Gets the value of the specified column as a char. |
java.sql.Clob |
getClob(int columnIndex)
Gets the value of the specified column as an Clob. |
java.sql.Clob |
getClob(TupleMetadata metadata,
java.lang.String columnName)
Gets the value of the specified column as a java.sql.Clob. |
int |
getColumnCount()
Get the number of columns in the tuple. |
java.sql.Date |
getDate(int columnIndex)
Gets the value of the specified column as a Date. |
java.sql.Date |
getDate(TupleMetadata metadata,
java.lang.String columnName)
Gets the value of the specified column as a Date. |
double |
getDouble(int columnIndex)
Gets the value of the specified column as a double. |
double |
getDouble(TupleMetadata metadata,
java.lang.String columnName)
Gets the value of the specified column as a double. |
java.io.File |
getFile(int columnIndex)
Gets the value of the specified column as a File. |
java.io.File |
getFile(TupleMetadata metadata,
java.lang.String columnName)
Gets the value of the specified column as a File. |
float |
getFloat(int columnIndex)
Gets the value of the specified column as a float. |
float |
getFloat(TupleMetadata metadata,
java.lang.String columnName)
Gets the value of the specified column as a float. |
int |
getInt(int columnIndex)
Gets the value of the specified column as an int. |
int |
getInt(TupleMetadata metadata,
java.lang.String columnName)
Gets the value of the specified column as an int. |
long |
getLong(int columnIndex)
Gets the value of the specified column as a long
It is the recommended Java mapping for the JDBC type BIGINT. |
long |
getLong(TupleMetadata metadata,
java.lang.String columnName)
Gets the value of the specified column as a long. |
java.lang.Object |
getObject(int columnIndex)
For cases where none of the below get methods fits. |
java.lang.Object |
getObject(TupleMetadata metadata,
java.lang.String columnName)
Gets the object of a specified column name of the tuple. |
short |
getShort(int columnIndex)
Gets the value of the specified column as a shprt. |
short |
getShort(TupleMetadata metadata,
java.lang.String columnName)
Gets the value of the specified column as a short. |
java.lang.String |
getString(int columnIndex)
Gets the value of the specified column as a String. |
java.lang.String |
getString(TupleMetadata metadata,
java.lang.String columnName)
Gets the value of the specified column as a String. |
java.sql.Time |
getTime(int columnIndex)
Gets the value of the specified column as a Time. |
java.sql.Time |
getTime(TupleMetadata metadata,
java.lang.String columnName)
Gets the value of the specified column as a Time. |
java.sql.Timestamp |
getTimestamp(int columnIndex)
Gets the value of the specified column as a Timestamp. |
java.sql.Timestamp |
getTimestamp(TupleMetadata metadata,
java.lang.String columnName)
Gets the value of the specified column as a Timestamp. |
int |
hashCode()
|
java.lang.String |
toString()
Auxiliary method to see the output of the Tuple Overrides the usual java toString() method. |
boolean |
wasNull()
Reports whether the last column read had a value of SQL NULL. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Null mODNULL
protected boolean mWasNull
protected java.util.List mElements
| Constructor Detail |
|---|
protected SimpleTuple()
public SimpleTuple(java.util.List elements)
elements - The list of elements of the tuple
public SimpleTuple(Tuple tupleA,
Tuple tupleB)
tupleA - tuple AtupleB - tuple B| Method Detail |
|---|
public int getColumnCount()
getColumnCount in interface Tuple
public java.lang.Object getObject(int columnIndex)
throws ColumnNotFoundException
getObject in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
ColumnNotFoundException - raised if the column number is out of bounds
public boolean getBoolean(int columnIndex)
throws ColumnNotFoundException
boolean.
It is the recommended Java mapping for the JDBC type BIT.
getBoolean in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
NULL, the
value returned is false
ColumnNotFoundException - raised if the column number is out of bounds
public float getFloat(int columnIndex)
throws ColumnNotFoundException
float.
It is the recommended Java mapping for the JDBC type REAL.
getFloat in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
NULL, the
value returned is 0
ColumnNotFoundException - raised if the column number is out of bounds
public int getInt(int columnIndex)
throws ColumnNotFoundException
int.
It is the recommended Java mapping for the JDBC type INTEGER.
getInt in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
NULL, the
value returned is 0
ColumnNotFoundException - raised if the column number is out of bounds
public long getLong(int columnIndex)
throws ColumnNotFoundException
long
It is the recommended Java mapping for the JDBC type BIGINT.
getLong in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
NULL, the
value returned is 0
ColumnNotFoundException - raised if the column number is out of bounds
public java.lang.String getString(int columnIndex)
throws ColumnNotFoundException
String.
It is the recommended Java mapping for the JDBC type CHAR, VARCHAR.
getString in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
NULL, the
value returned is null
ColumnNotFoundException - raised if the column number is out of bounds
public char getChar(int columnIndex)
throws ColumnNotFoundException
char.
getChar in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
NULL, the
value returned is 0
ColumnNotFoundException - raised if the column number is out of bounds
public double getDouble(int columnIndex)
throws ColumnNotFoundException
double. It is
the recommended Java mapping for the JDBC type DOUBLE, FLOAT.
getDouble in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
NULL, the
value returned is 0
ColumnNotFoundException - raised if the column number is out of bounds
java.lang.NumberFormatException - if the value cannot be converted into a double
public short getShort(int columnIndex)
throws ColumnNotFoundException
shprt.
It is the recommended Java mapping for the JDBC type TINYINT, SMALLINT.
getShort in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
NULL, the
value returned is 0
ColumnNotFoundException - raised if the column number is out of bounds
public java.io.File getFile(int columnIndex)
throws ColumnNotFoundException
File.
getFile in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
NULL, the
value returned is null
ColumnNotFoundException - raised if the column number is out of bounds
public java.sql.Date getDate(int columnIndex)
throws ColumnNotFoundException
Date.
getDate in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
NULL, the
value returned is null
ColumnNotFoundException - raised if the column number is out of bounds
public java.sql.Time getTime(int columnIndex)
throws ColumnNotFoundException
Time.
getTime in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
NULL, the
value returned is null
ColumnNotFoundException - raised if the column number is out of bounds
public java.sql.Timestamp getTimestamp(int columnIndex)
throws ColumnNotFoundException
Timestamp.
getTimestamp in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
NULL, the
value returned is null
ColumnNotFoundException - raised if the column number is out of bounds
public java.math.BigDecimal getBigDecimal(int columnIndex)
throws ColumnNotFoundException
BigDecimal.
It is the recommended Java mapping for the JDBC type NUMERIC(,DECIMAL).
getBigDecimal in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
NULL, the
value returned is null
ColumnNotFoundException - raised if the column number is out of bounds
public java.sql.Blob getBlob(int columnIndex)
throws ColumnNotFoundException
Blob.
getBlob in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
NULL, the
value returned is null
ColumnNotFoundException - raised if the column number is out of bounds
public java.sql.Clob getClob(int columnIndex)
throws ColumnNotFoundException
Clob.
getClob in interface TuplecolumnIndex - the first column is 0, the second is 1, ...
NULL, the
value returned is null
ColumnNotFoundException - raised if the column number is out of bounds
public java.lang.Object getObject(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
getObject in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
ColumnNotFoundException - raised if the column name does not exist
public boolean getBoolean(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
boolean.
getBoolean in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
NULL, the
value returned is false
ColumnNotFoundException - raised if the column name does not exist
public float getFloat(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
float.
getFloat in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
NULL, the
value returned is 0
ColumnNotFoundException - raised if the column name does not exist
public int getInt(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
int.
getInt in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
NULL, the
value returned is 0
ColumnNotFoundException - raised if the column name does not exist
public long getLong(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
long.
getLong in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
NULL, the
value returned is 0
ColumnNotFoundException - raised if the column name does not exist
public java.lang.String getString(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
String.
getString in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
NULL, the
value returned is null
ColumnNotFoundException - raised if the column name does not exist
public char getChar(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
char.
getChar in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
NULL, the
value returned is 0
ColumnNotFoundException - raised if the column name does not exist
public double getDouble(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
double.
getDouble in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
NULL, the
value returned is 0
ColumnNotFoundException - raised if the column name does not exist
public short getShort(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
short.
getShort in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
NULL, the
value returned is 0
ColumnNotFoundException - raised if the column name does not exist
public java.io.File getFile(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
File.
getFile in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
NULL, the
value returned is null
ColumnNotFoundException - raised if the column name does not exist
public java.sql.Date getDate(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
Date.
getDate in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
NULL, the
value returned is null
ColumnNotFoundException - raised if the column name does not exist
public java.sql.Time getTime(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
Time.
getTime in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
NULL, the
value returned is null
ColumnNotFoundException - raised if the column name does not exist
public java.sql.Timestamp getTimestamp(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
Timestamp.
getTimestamp in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
NULL, the
value returned is null
ColumnNotFoundException - raised if the column name does not exist
public java.math.BigDecimal getBigDecimal(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
BigDecimal.
getBigDecimal in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
NULL, the
value returned is null
ColumnNotFoundException - raised if the column name does not exist
public java.sql.Blob getBlob(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
Blob.
getBlob in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
NULL, the
value returned is null
ColumnNotFoundException - raised if the column name does not exist
public java.sql.Clob getClob(TupleMetadata metadata,
java.lang.String columnName)
throws ColumnNotFoundException
java.sql.Clob.
getClob in interface Tuplemetadata - metadata describing the tuple.columnName - the column name
NULL, the
value returned is null
ColumnNotFoundException - raised if the column name does not existpublic boolean wasNull()
NULL.
Note that you must first call one of the getter methods on a column to
try to read its value and then call the method wasNull to
see if the value read was SQL NULL.
wasNull in interface Tupletrue if the last column value read was SQL
NULL and false otherwisepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||