|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.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 Tuple
Tuple.getSchema()
public Table getTable()
Tuple
getTable
in interface Tuple
Tuple.getTable()
public int getRow()
Tuple
getRow
in interface Tuple
Tuple.getRow()
public boolean isValid()
Tuple
isValid
in interface Tuple
Tuple.isValid()
public java.lang.Class getColumnType(java.lang.String field)
Tuple
getColumnType
in interface Tuple
field
- the data field
Tuple.getColumnType(java.lang.String)
public java.lang.Class getColumnType(int col)
Tuple
getColumnType
in interface Tuple
col
- the column index
Tuple.getColumnType(int)
public int getColumnIndex(java.lang.String field)
Tuple
getColumnIndex
in interface Tuple
field
- the data field to look up
Tuple.getColumnIndex(java.lang.String)
public int getColumnCount()
Tuple
getColumnCount
in interface Tuple
Tuple.getColumnCount()
public java.lang.String getColumnName(int col)
Tuple
getColumnName
in interface Tuple
col
- the column index to look up
Tuple.getColumnName(int)
public boolean canGet(java.lang.String field, java.lang.Class type)
Tuple
get
method for the given data field returns
values that are compatible with a given target type.
canGet
in interface Tuple
field
- 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)
Tuple
set
method for the given data field can
accept values of a given target type.
canSet
in interface Tuple
field
- 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 Tuple
field
- 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 Tuple
field
- 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 Tuple
idx
- the column number
Tuple.get(int)
public final void set(int idx, java.lang.Object value)
Tuple
set
in interface Tuple
idx
- 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 Tuple
field
- the data field
Tuple.getDefault(java.lang.String)
public void revertToDefault(java.lang.String field)
Tuple
revertToDefault
in interface Tuple
field
- the data fieldTuple.revertToDefault(java.lang.String)
public final boolean canGetInt(java.lang.String field)
Tuple
int
values.
canGetInt
in interface Tuple
field
- 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)
Tuple
setInt
method can safely be used for the
given data field.
canSetInt
in interface Tuple
field
- 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)
Tuple
int
.
getInt
in interface Tuple
field
- the data field to retrieveTuple.getInt(java.lang.String)
public final void setInt(java.lang.String field, int val)
Tuple
int
.
setInt
in interface Tuple
field
- the data field to setval
- the value to setTuple.setInt(java.lang.String, int)
public final int getInt(int col)
Tuple
int
.
getInt
in interface Tuple
col
- the column number of the data field to retrieveTuple.getInt(int)
public final void setInt(int col, int val)
Tuple
int
.
setInt
in interface Tuple
col
- the column number of the data field to setval
- the value to setTuple.setInt(int, int)
public final boolean canGetLong(java.lang.String field)
Tuple
long
values.
canGetLong
in interface Tuple
field
- 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)
Tuple
setLong
method can safely be used for the
given data field.
canSetLong
in interface Tuple
field
- 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)
Tuple
long
.
getLong
in interface Tuple
field
- the data field to retrieveTuple.getLong(java.lang.String)
public final void setLong(java.lang.String field, long val)
Tuple
long
.
setLong
in interface Tuple
field
- the data field to setval
- the value to setTuple.setLong(java.lang.String, long)
public final long getLong(int col)
Tuple
long
.
getLong
in interface Tuple
col
- the column number of the data field to retrieveTuple.getLong(int)
public final void setLong(int col, long val)
Tuple
long
.
setLong
in interface Tuple
col
- the column number of the data field to setval
- the value to setTuple.setLong(int, long)
public final boolean canGetFloat(java.lang.String field)
Tuple
float
values.
canGetFloat
in interface Tuple
field
- 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)
Tuple
setFloat
method can safely be used for the
given data field.
canSetFloat
in interface Tuple
field
- 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)
Tuple
float
.
getFloat
in interface Tuple
field
- the data field to retrieveTuple.getFloat(java.lang.String)
public final void setFloat(java.lang.String field, float val)
Tuple
float
.
setFloat
in interface Tuple
field
- the data field to setval
- the value to setTuple.setFloat(java.lang.String, float)
public final float getFloat(int col)
Tuple
float
.
getFloat
in interface Tuple
col
- the column number of the data field to retrieveTuple.getFloat(int)
public final void setFloat(int col, float val)
Tuple
float
.
setFloat
in interface Tuple
col
- the column number of the data field to setval
- the value to setTuple.setFloat(int, float)
public final boolean canGetDouble(java.lang.String field)
Tuple
double
values.
canGetDouble
in interface Tuple
field
- 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)
Tuple
setDouble
method can safely be used for the
given data field.
canSetDouble
in interface Tuple
field
- 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)
Tuple
double
.
getDouble
in interface Tuple
field
- the data field to retrieveTuple.getDouble(java.lang.String)
public final void setDouble(java.lang.String field, double val)
Tuple
double
.
setDouble
in interface Tuple
field
- the data field to setval
- the value to setTuple.setDouble(java.lang.String, double)
public final double getDouble(int col)
Tuple
double
.
getDouble
in interface Tuple
col
- the column number of the data field to retrieveTuple.getDouble(int)
public final void setDouble(int col, double val)
Tuple
double
.
setDouble
in interface Tuple
col
- the column number of the data field to setval
- the value to setTuple.setDouble(int, double)
public final boolean canGetBoolean(java.lang.String field)
Tuple
boolean
values.
canGetBoolean
in interface Tuple
field
- 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)
Tuple
setBoolean
method can safely be used for the
given data field.
canSetBoolean
in interface Tuple
field
- 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)
Tuple
boolean
.
getBoolean
in interface Tuple
field
- the data field to retrieveTuple.getBoolean(java.lang.String)
public final void setBoolean(java.lang.String field, boolean val)
Tuple
boolean
.
setBoolean
in interface Tuple
field
- the data field to setval
- the value to setTuple.setBoolean(java.lang.String, boolean)
public final boolean getBoolean(int col)
Tuple
boolean
.
getBoolean
in interface Tuple
col
- the column number of the data field to retrieveTuple.getBoolean(int)
public final void setBoolean(int col, boolean val)
Tuple
boolean
.
setBoolean
in interface Tuple
col
- 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)
Tuple
String
values.
canGetString
in interface Tuple
field
- 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)
Tuple
setString
method can safely be used for the
given data field.
canSetString
in interface Tuple
field
- 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)
Tuple
String
.
getString
in interface Tuple
field
- the data field to retrieveTuple.getString(java.lang.String)
public final void setString(java.lang.String field, java.lang.String val)
Tuple
String
.
setString
in interface Tuple
field
- the data field to setval
- the value to setTuple.setString(java.lang.String, java.lang.String)
public final java.lang.String getString(int col)
Tuple
String
.
getString
in interface Tuple
col
- the column number of the data field to retrieveTuple.getString(int)
public final void setString(int col, java.lang.String val)
Tuple
String
.
setString
in interface Tuple
col
- 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)
Tuple
Date
values.
canGetDate
in interface Tuple
field
- 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)
Tuple
setDate
method can safely be used for the
given data field.
canSetDate
in interface Tuple
field
- 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)
Tuple
Date
.
getDate
in interface Tuple
field
- the data field to retrieveTuple.getDate(java.lang.String)
public final void setDate(java.lang.String field, java.util.Date val)
Tuple
Date
.
setDate
in interface Tuple
field
- the data field to setval
- the value to setTuple.setDate(java.lang.String, java.util.Date)
public final java.util.Date getDate(int col)
Tuple
Date
.
getDate
in interface Tuple
col
- the column number of the data field to retrieveTuple.getDate(int)
public final void setDate(int col, java.util.Date val)
Tuple
Date
.
setDate
in interface Tuple
col
- 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.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |