|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.aria.data.DataModel
org.formaria.aria.data.table.RowModel
public class RowModel
Provides a model for table rows. The attributes are equivalent to the row fields. The row will have no children. As a Java object the fields and rows indices are zero based in contrast to the JDBC indexing setup.
The class is not intended to be used directly except in rare circumstances, instead most access will be via the model and bindings or via the TableModel class
Copyright (c) Formaria Ltd. 2008
$Revision: 2.7 $ License: see license.txt
| Field Summary | |
|---|---|
protected int |
rowIdx
|
protected TableModel |
sourceData
|
| Fields inherited from class org.formaria.aria.data.DataModel |
|---|
parentModel, tagName |
| Constructor Summary | |
|---|---|
RowModel()
Default constructor, no table or row is referenced |
|
RowModel(TableModel table,
int row)
Construct a model node for a table |
|
| Method Summary | |
|---|---|
void |
append(DataModel newObject)
Append a node. |
java.lang.Object |
append(java.lang.String id)
This method does not nothing it is provided merely as an implementation of the DataModel interface. |
java.lang.Object |
get()
Gets the value attribute |
DataModel |
get(int i)
Gets the value attribute - a field value |
java.lang.Object |
get(java.lang.String attribName)
Get a field value |
java.lang.String |
getAttribName(int i)
Get the name of an attribute |
int |
getAttribute(java.lang.String attribName)
returns the index of the attribiteNames array whose value is the same as the attribName |
java.lang.Object |
getAttribValue(int i)
Get the value of an attribute |
double |
getAttribValueAsDouble(int i)
Deprecated. use getAttribValueAsDouble( i, decimalSeparator, groupingSeparator ) instead, if the locale is different from the locale used to write the values to the model, then the parsed value may be incorrect. |
double |
getAttribValueAsDouble(int i,
char decimalSeparator,
char groupSeparator)
Get an attribute value as a double |
int |
getAttribValueAsInt(int i)
Get an attribute value as a string |
java.lang.String |
getAttribValueAsString(int i)
Get an attribute as a string |
double |
getDouble(java.lang.String attribName)
Get a field value as an double |
java.lang.String |
getFieldValue(int fieldIdx)
Gets an individual field value |
java.lang.String |
getId()
Get the ID of this row |
int |
getInt(java.lang.String attribName)
Get a field value as an int |
int |
getNumChildren()
Gets the number of fields for this row |
java.lang.String |
getString(java.lang.String attribName)
Get a field value as an String |
TableModel |
getTable()
Get the referenced table |
java.lang.String |
getTagName()
Gets the model element tag name, e.g. |
java.lang.String |
getValue()
Get the value of the first field in this row |
DataModel |
getValue(int i)
Get the value of a field as a model node |
double |
getValueAsDouble(java.lang.String elementName)
Get a field as a double value |
int |
getValueAsInt(java.lang.String elementName)
Get an attribute as an int value |
java.lang.String |
getValueAsString(java.lang.String elementName)
Gets the value attribute of the specified node as a string. |
int |
hashCode()
Get the hashcode for this row |
void |
remove(DataModel node)
Remove a node |
void |
set(java.lang.Object s)
Sets the model value |
void |
set(java.lang.String attribName,
java.lang.Object newObject)
Set the value of the DataModel located at the elementName |
void |
setAttribValue(int i,
java.lang.Object value)
Sets the attribute (field) value |
void |
setAttribValue(int i,
java.lang.String attribName,
java.lang.Object value)
Sets the attribute (field) value |
void |
setFieldValue(int colIdx,
java.lang.String newValue)
Set the value of a field |
void |
setRowReference(TableModel table,
int row)
Set the row to reference |
| Methods inherited from class org.formaria.aria.data.DataModel |
|---|
addModelListener, clear, fireModelUpdated, getNumAttributes, getParent, hasAutoId, hasAutoId, prefixOutputPath, removeChildren, reset, resetAttributes, setId, setNumAttributes, setNumChildren, setParent, setTagName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int rowIdx
protected TableModel sourceData
| Constructor Detail |
|---|
public RowModel()
public RowModel(TableModel table,
int row)
table - the table to referencerow - the row to reference| Method Detail |
|---|
public TableModel getTable()
public void setRowReference(TableModel table,
int row)
table - the table to referencerow - the row to referencepublic double getValueAsDouble(java.lang.String elementName)
This method is required by the DataModel interface but in this case it is not implemented as it is inappropriate in the context of the class
Try getDouble instead
getValueAsDouble in class DataModelelementName - the field name
public java.lang.Object get(java.lang.String attribName)
get in class DataModelattribName - the field name
public java.lang.String getTagName()
getTagName in class DataModelpublic void append(DataModel newObject)
append in class DataModelnewObject - the object to appendpublic int getInt(java.lang.String attribName)
attribName - the fieldName
public double getDouble(java.lang.String attribName)
attribName - the fieldName
public java.lang.String getString(java.lang.String attribName)
attribName - the fieldName
public java.lang.String getValue()
public java.lang.String getFieldValue(int fieldIdx)
fieldIdx - the field index
public java.lang.Object getAttribValue(int i)
getAttribValue in class DataModeli - the index of the attribute
public java.lang.String getAttribValueAsString(int i)
getAttribValueAsString in class DataModeli - the index of the attribute
public java.lang.String getValueAsString(java.lang.String elementName)
getValueAsString in class DataModelelementName - the child element name
public java.lang.String getId()
getId in class DataModelpublic java.lang.String getAttribName(int i)
getAttribName in class DataModeli - the index of the attribute
public int getAttribute(java.lang.String attribName)
getAttribute in class DataModelattribName - The name of the attribute we are trying to locate
public void set(java.lang.String attribName,
java.lang.Object newObject)
set in class DataModelattribName - The path to the DataModel in the format 'base/foonewObject - The new value of the DataModelpublic void set(java.lang.Object s)
set in class DataModels - the new valuepublic DataModel get(int i)
get in class DataModeli - the field index
public java.lang.Object get()
get in class DataModelpublic java.lang.Object append(java.lang.String id)
append in class DataModelid - the node id
public int getValueAsInt(java.lang.String elementName)
This method is required by the DataModel interface but in this case it is not implemented as it is inappropriate in the context of the class
getValueAsInt in class DataModelelementName - The name of the element whose value we want
public DataModel getValue(int i)
i - the field index
public void setAttribValue(int i,
java.lang.Object value)
setAttribValue in class DataModeli - The index of the attributeValues array whose value we wantvalue - the value object
public void setAttribValue(int i,
java.lang.String attribName,
java.lang.Object value)
setAttribValue in class DataModeli - The index of the attributeValues array whose value we wantattribName - - ignoredvalue - the value object
public void setFieldValue(int colIdx,
java.lang.String newValue)
colIdx - the field indexnewValue - the new field valuepublic int hashCode()
hashCode in class DataModelpublic int getNumChildren()
getNumChildren in class DataModelpublic double getAttribValueAsDouble(int i)
getAttribValueAsDouble in class DataModeli - The index of the attributeValues array whose value we want
public double getAttribValueAsDouble(int i,
char decimalSeparator,
char groupSeparator)
getAttribValueAsDouble in class DataModeli - The index of the attributeValues array whose value we wantdecimalSeparator - the decimal separatorgroupingSeparator - the grouping (thousands) separator
public int getAttribValueAsInt(int i)
getAttribValueAsInt in class DataModeli - The index of the attributeValues array whose value we want
public void remove(DataModel node)
This method is required by the DataModel interface but in this case it is not implemented as it is inappropriate in the context of the class
node - - ignored
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||