|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectprefuse.data.tuple.TableTuple
public class TableTuple
Tuple implementation that pulls values from a backing data Table.
| Field Summary | |
|---|---|
protected int |
m_row
|
protected Table |
m_table
|
| Constructor Summary | |
|---|---|
TableTuple()
|
|
| Method Summary | |
|---|---|
boolean |
canGet(java.lang.String field,
java.lang.Class type)
Check if the get method for the given data field returns
values that are compatible with a given target type. |
boolean |
canGetBoolean(java.lang.String field)
Check if the given data field can return primitive boolean
values. |
boolean |
canGetDate(java.lang.String field)
Check if the given data field can return Date
values. |
boolean |
canGetDouble(java.lang.String field)
Check if the given data field can return primitive double
values. |
boolean |
canGetFloat(java.lang.String field)
Check if the given data field can return primitive float
values. |
boolean |
canGetInt(java.lang.String field)
Check if the given data field can return primitive int
values. |
boolean |
canGetLong(java.lang.String field)
Check if the given data field can return primitive long
values. |
boolean |
canGetString(java.lang.String field)
Check if the given data field can return String
values. |
boolean |
canSet(java.lang.String field,
java.lang.Class type)
Check if the set method for the given data field can
accept values of a given target type. |
boolean |
canSetBoolean(java.lang.String field)
Check if the setBoolean method can safely be used for the
given data field. |
boolean |
canSetDate(java.lang.String field)
Check if the setDate method can safely be used for the
given data field. |
boolean |
canSetDouble(java.lang.String field)
Check if the setDouble method can safely be used for the
given data field. |
boolean |
canSetFloat(java.lang.String field)
Check if the setFloat method can safely be used for the
given data field. |
boolean |
canSetInt(java.lang.String field)
Check if the setInt method can safely be used for the
given data field. |
boolean |
canSetLong(java.lang.String field)
Check if the setLong method can safely be used for the
given data field. |
boolean |
canSetString(java.lang.String field)
Check if the setString method can safely be used for the
given data field. |
java.lang.Object |
get(int idx)
Get the data value at the given column number as an Object. |
java.lang.Object |
get(java.lang.String field)
Get the data value at the given field as an Object. |
boolean |
getBoolean(int col)
Get the data value at the given field as a boolean. |
boolean |
getBoolean(java.lang.String field)
Get the data value at the given field as a boolean. |
int |
getColumnCount()
Get the number of columns maintained by the backing table. |
int |
getColumnIndex(java.lang.String field)
Get the column index corresponding to the given data field. |
java.lang.String |
getColumnName(int col)
Get the data field name of the column at the given index. |
java.lang.Class |
getColumnType(int col)
Returns the data type of the given column as a Java Class instance. |
java.lang.Class |
getColumnType(java.lang.String field)
Returns the data type of the given field as a Java Class instance. |
java.util.Date |
getDate(int col)
Get the data value at the given field as a Date. |
java.util.Date |
getDate(java.lang.String field)
Get the data value at the given field as a Date. |
java.lang.Object |
getDefault(java.lang.String field)
Get the default value for the given data field. |
double |
getDouble(int col)
Get the data value at the given field as a double. |
double |
getDouble(java.lang.String field)
Get the data value at the given field as a double. |
float |
getFloat(int col)
Get the data value at the given field as a float. |
float |
getFloat(java.lang.String field)
Get the data value at the given field as a float. |
int |
getInt(int col)
Get the data value at the given field as an int. |
int |
getInt(java.lang.String field)
Get the data value at the given field as an int. |
long |
getLong(int col)
Get the data value at the given field as a long. |
long |
getLong(java.lang.String field)
Get the data value at the given field as a long. |
int |
getRow()
Returns the row index for this Tuple's backing Table, if it exists. |
Schema |
getSchema()
Returns the schema for this tuple's data. |
java.lang.String |
getString(int col)
Get the data value at the given field as a String. |
java.lang.String |
getString(java.lang.String field)
Get the data value at the given field as a String. |
Table |
getTable()
Returns the Table instance that backs this Tuple, if it exists. |
protected void |
init(Table table,
Graph graph,
int row)
Initialize a new TableTuple for the given table and row. |
boolean |
isValid()
Indicates if this Tuple is valid. |
void |
revertToDefault(java.lang.String field)
Revert this tuple's value for the given field to the default value for the field. |
void |
set(int idx,
java.lang.Object value)
Set the value of at the given column number. |
void |
set(java.lang.String field,
java.lang.Object value)
Set the value of a given data field. |
void |
setBoolean(int col,
boolean val)
Set the data value of the given field with a boolean. |
void |
setBoolean(java.lang.String field,
boolean val)
Set the data value of the given field with a boolean. |
void |
setDate(int col,
java.util.Date val)
Set the data value of the given field with a Date. |
void |
setDate(java.lang.String field,
java.util.Date val)
Set the data value of the given field with a Date. |
void |
setDouble(int col,
double val)
Set the data value of the given field with a double. |
void |
setDouble(java.lang.String field,
double val)
Set the data value of the given field with a double. |
void |
setFloat(int col,
float val)
Set the data value of the given field with a float. |
void |
setFloat(java.lang.String field,
float val)
Set the data value of the given field with a float. |
void |
setInt(int col,
int val)
Set the data value of the given field with an int. |
void |
setInt(java.lang.String field,
int val)
Set the data value of the given field with an int. |
void |
setLong(int col,
long val)
Set the data value of the given field with a long. |
void |
setLong(java.lang.String field,
long val)
Set the data value of the given field with a long. |
void |
setString(int col,
java.lang.String val)
Set the data value of the given field with a String. |
void |
setString(java.lang.String field,
java.lang.String val)
Set the data value of the given field with a String. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Table m_table
protected int m_row
| Constructor Detail |
|---|
public TableTuple()
| Method Detail |
|---|
protected void init(Table table,
Graph graph,
int row)
TupleManager instances, and
so application code should never need to invoke this method.
table - the data Tablegraph - ignored by this classrow - the table row indexpublic Schema getSchema()
Tuple
getSchema in interface TupleTuple.getSchema()public Table getTable()
Tuple
getTable in interface TupleTuple.getTable()public int getRow()
Tuple
getRow in interface TupleTuple.getRow()public boolean isValid()
Tuple
isValid in interface TupleTuple.isValid()public java.lang.Class getColumnType(java.lang.String field)
Tuple
getColumnType in interface Tuplefield - the data field
Tuple.getColumnType(java.lang.String)public java.lang.Class getColumnType(int col)
Tuple
getColumnType in interface Tuplecol - the column index
Tuple.getColumnType(int)public int getColumnIndex(java.lang.String field)
Tuple
getColumnIndex in interface Tuplefield - the data field to look up
Tuple.getColumnIndex(java.lang.String)public int getColumnCount()
Tuple
getColumnCount in interface TupleTuple.getColumnCount()public java.lang.String getColumnName(int col)
Tuple
getColumnName in interface Tuplecol - the column index to look up
Tuple.getColumnName(int)
public boolean canGet(java.lang.String field,
java.lang.Class type)
Tupleget method for the given data field returns
values that are compatible with a given target type.
canGet in interface Tuplefield - the data field to checktype - a Class instance to check for compatibility with the
data field values.
Tuple.get(String) can be cast to the given type.Tuple.canGet(java.lang.String, java.lang.Class)
public boolean canSet(java.lang.String field,
java.lang.Class type)
Tupleset method for the given data field can
accept values of a given target type.
canSet in interface Tuplefield - the data field to checktype - a Class instance to check for compatibility with the
data field values.
Tuple.set(String, Object) method.Tuple.canSet(java.lang.String, java.lang.Class)public final java.lang.Object get(java.lang.String field)
Tuple
get in interface Tuplefield - the data field to retrieve
Tuple.get(java.lang.String)
public final void set(java.lang.String field,
java.lang.Object value)
Tuple
set in interface Tuplefield - the data field to setvalue - the value for the field. If the concrete type of this
Object is not compatible with the underlying data model, an
Exception will be thrown. Use the Tuple.canSet(String, Class)
method to check the type-safety ahead of time.Tuple.set(java.lang.String, java.lang.Object)public final java.lang.Object get(int idx)
Tuple
get in interface Tupleidx - the column number
Tuple.get(int)
public final void set(int idx,
java.lang.Object value)
Tuple
set in interface Tupleidx - the column numbervalue - the value for the field. If the concrete type of this
Object is not compatible with the underlying data model, an
Exception will be thrown. Use the Tuple.canSet(String, Class)
method to check the type-safety ahead of time.Tuple.set(int, java.lang.Object)public java.lang.Object getDefault(java.lang.String field)
Tuple
getDefault in interface Tuplefield - the data field
Tuple.getDefault(java.lang.String)public void revertToDefault(java.lang.String field)
Tuple
revertToDefault in interface Tuplefield - the data fieldTuple.revertToDefault(java.lang.String)public final boolean canGetInt(java.lang.String field)
Tupleint
values.
canGetInt in interface Tuplefield - the data field to check
int
values, false otherwise. If true, the Tuple.getInt(String) method
can be used safely.Tuple.canGetInt(java.lang.String)public final boolean canSetInt(java.lang.String field)
TuplesetInt method can safely be used for the
given data field.
canSetInt in interface Tuplefield - the data field to check
Tuple.setInt(String, int) method can safely
be used for the given field, false otherwise.Tuple.canSetInt(java.lang.String)public final int getInt(java.lang.String field)
Tupleint.
getInt in interface Tuplefield - the data field to retrieveTuple.getInt(java.lang.String)
public final void setInt(java.lang.String field,
int val)
Tupleint.
setInt in interface Tuplefield - the data field to setval - the value to setTuple.setInt(java.lang.String, int)public final int getInt(int col)
Tupleint.
getInt in interface Tuplecol - the column number of the data field to retrieveTuple.getInt(int)
public final void setInt(int col,
int val)
Tupleint.
setInt in interface Tuplecol - the column number of the data field to setval - the value to setTuple.setInt(int, int)public final boolean canGetLong(java.lang.String field)
Tuplelong
values.
canGetLong in interface Tuplefield - the data field to check
long
values, false otherwise. If true, the Tuple.getLong(String) method
can be used safely.Tuple.canGetLong(java.lang.String)public final boolean canSetLong(java.lang.String field)
TuplesetLong method can safely be used for the
given data field.
canSetLong in interface Tuplefield - the data field to check
Tuple.setLong(String, long) method can safely
be used for the given field, false otherwise.Tuple.canSetLong(java.lang.String)public final long getLong(java.lang.String field)
Tuplelong.
getLong in interface Tuplefield - the data field to retrieveTuple.getLong(java.lang.String)
public final void setLong(java.lang.String field,
long val)
Tuplelong.
setLong in interface Tuplefield - the data field to setval - the value to setTuple.setLong(java.lang.String, long)public final long getLong(int col)
Tuplelong.
getLong in interface Tuplecol - the column number of the data field to retrieveTuple.getLong(int)
public final void setLong(int col,
long val)
Tuplelong.
setLong in interface Tuplecol - the column number of the data field to setval - the value to setTuple.setLong(int, long)public final boolean canGetFloat(java.lang.String field)
Tuplefloat
values.
canGetFloat in interface Tuplefield - the data field to check
float
values, false otherwise. If true, the Tuple.getFloat(String) method
can be used safely.Tuple.canGetFloat(java.lang.String)public final boolean canSetFloat(java.lang.String field)
TuplesetFloat method can safely be used for the
given data field.
canSetFloat in interface Tuplefield - the data field to check
Tuple.setFloat(String, float) method can safely
be used for the given field, false otherwise.Tuple.canSetFloat(java.lang.String)public final float getFloat(java.lang.String field)
Tuplefloat.
getFloat in interface Tuplefield - the data field to retrieveTuple.getFloat(java.lang.String)
public final void setFloat(java.lang.String field,
float val)
Tuplefloat.
setFloat in interface Tuplefield - the data field to setval - the value to setTuple.setFloat(java.lang.String, float)public final float getFloat(int col)
Tuplefloat.
getFloat in interface Tuplecol - the column number of the data field to retrieveTuple.getFloat(int)
public final void setFloat(int col,
float val)
Tuplefloat.
setFloat in interface Tuplecol - the column number of the data field to setval - the value to setTuple.setFloat(int, float)public final boolean canGetDouble(java.lang.String field)
Tupledouble
values.
canGetDouble in interface Tuplefield - the data field to check
double
values, false otherwise. If true, the Tuple.getDouble(String) method
can be used safely.Tuple.canGetDouble(java.lang.String)public final boolean canSetDouble(java.lang.String field)
TuplesetDouble method can safely be used for the
given data field.
canSetDouble in interface Tuplefield - the data field to check
Tuple.setDouble(String, double) method can safely
be used for the given field, false otherwise.Tuple.canSetDouble(java.lang.String)public final double getDouble(java.lang.String field)
Tupledouble.
getDouble in interface Tuplefield - the data field to retrieveTuple.getDouble(java.lang.String)
public final void setDouble(java.lang.String field,
double val)
Tupledouble.
setDouble in interface Tuplefield - the data field to setval - the value to setTuple.setDouble(java.lang.String, double)public final double getDouble(int col)
Tupledouble.
getDouble in interface Tuplecol - the column number of the data field to retrieveTuple.getDouble(int)
public final void setDouble(int col,
double val)
Tupledouble.
setDouble in interface Tuplecol - the column number of the data field to setval - the value to setTuple.setDouble(int, double)public final boolean canGetBoolean(java.lang.String field)
Tupleboolean
values.
canGetBoolean in interface Tuplefield - the data field to check
boolean
values, false otherwise. If true, the Tuple.getBoolean(String) method
can be used safely.Tuple.canGetBoolean(java.lang.String)public final boolean canSetBoolean(java.lang.String field)
TuplesetBoolean method can safely be used for the
given data field.
canSetBoolean in interface Tuplefield - the data field to check
Tuple.setBoolean(String, boolean) method can
safely be used for the given field, false otherwise.Tuple.canSetBoolean(java.lang.String)public final boolean getBoolean(java.lang.String field)
Tupleboolean.
getBoolean in interface Tuplefield - the data field to retrieveTuple.getBoolean(java.lang.String)
public final void setBoolean(java.lang.String field,
boolean val)
Tupleboolean.
setBoolean in interface Tuplefield - the data field to setval - the value to setTuple.setBoolean(java.lang.String, boolean)public final boolean getBoolean(int col)
Tupleboolean.
getBoolean in interface Tuplecol - the column number of the data field to retrieveTuple.getBoolean(int)
public final void setBoolean(int col,
boolean val)
Tupleboolean.
setBoolean in interface Tuplecol - the column number of the data field to setval - the value to setTuple.setBoolean(java.lang.String, boolean)public final boolean canGetString(java.lang.String field)
TupleString
values.
canGetString in interface Tuplefield - the data field to check
String
values, false otherwise. If true, the Tuple.getString(String) method
can be used safely.Tuple.canGetString(java.lang.String)public final boolean canSetString(java.lang.String field)
TuplesetString method can safely be used for the
given data field.
canSetString in interface Tuplefield - the data field to check
Tuple.setString(String, String) method can safely
be used for the given field, false otherwise.Tuple.canSetString(java.lang.String)public final java.lang.String getString(java.lang.String field)
TupleString.
getString in interface Tuplefield - the data field to retrieveTuple.getString(java.lang.String)
public final void setString(java.lang.String field,
java.lang.String val)
TupleString.
setString in interface Tuplefield - the data field to setval - the value to setTuple.setString(java.lang.String, java.lang.String)public final java.lang.String getString(int col)
TupleString.
getString in interface Tuplecol - the column number of the data field to retrieveTuple.getString(int)
public final void setString(int col,
java.lang.String val)
TupleString.
setString in interface Tuplecol - the column number of the data field to setval - the value to setTuple.setString(int, java.lang.String)public final boolean canGetDate(java.lang.String field)
TupleDate
values.
canGetDate in interface Tuplefield - the data field to check
Date
values, false otherwise. If true, the Tuple.getDate(String) method
can be used safely.Tuple.canGetDate(java.lang.String)public final boolean canSetDate(java.lang.String field)
TuplesetDate method can safely be used for the
given data field.
canSetDate in interface Tuplefield - the data field to check
Tuple.setDate(String, Date) method can safely
be used for the given field, false otherwise.Tuple.canSetDate(java.lang.String)public final java.util.Date getDate(java.lang.String field)
TupleDate.
getDate in interface Tuplefield - the data field to retrieveTuple.getDate(java.lang.String)
public final void setDate(java.lang.String field,
java.util.Date val)
TupleDate.
setDate in interface Tuplefield - the data field to setval - the value to setTuple.setDate(java.lang.String, java.util.Date)public final java.util.Date getDate(int col)
TupleDate.
getDate in interface Tuplecol - the column number of the data field to retrieveTuple.getDate(int)
public final void setDate(int col,
java.util.Date val)
TupleDate.
setDate in interface Tuplecol - the column number of the data field to setval - the value to setTuple.setDate(java.lang.String, java.util.Date)public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||