|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.xui.data.XModel
net.xoetrope.optional.data.sql.DatabaseRowModel
public class DatabaseRowModel
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 DatabaseTableModel class
Copyright (c) Xoetrope Ltd. 2001-2003
$Revision: 2.7 $ License: see license.txt
| Field Summary | |
|---|---|
protected int |
rowIdx
|
protected DatabaseTableModel |
xtable
|
| Fields inherited from class net.xoetrope.xui.data.XModel |
|---|
parentModel, tagName |
| Constructor Summary | |
|---|---|
DatabaseRowModel()
Default constructor, no table or row is referenced |
|
DatabaseRowModel(DatabaseTableModel table,
int row)
Construct a model node for a table |
|
| Method Summary | |
|---|---|
java.lang.Object |
append(java.lang.String id)
This method does not nothing it is provided merely as an implementation of the XModel interface. |
void |
append(XModel newObject)
Append a node. |
java.lang.Object |
get()
Gets the value attribute |
XModel |
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)
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 |
DatabaseTableModel |
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 |
XModel |
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(XModel 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 XModel 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(DatabaseTableModel table,
int row)
Set the row to reference |
| Methods inherited from class net.xoetrope.xui.data.XModel |
|---|
addModelListener, clear, fireModelUpdated, getInstance, 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 DatabaseTableModel xtable
| Constructor Detail |
|---|
public DatabaseRowModel()
public DatabaseRowModel(DatabaseTableModel table,
int row)
table - the table to referencerow - the row to reference| Method Detail |
|---|
public DatabaseTableModel getTable()
public void setRowReference(DatabaseTableModel table,
int row)
table - the table to referencerow - the row to referencepublic double getValueAsDouble(java.lang.String elementName)
This method is required by the XModel 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 XModelelementName - the field name
public java.lang.Object get(java.lang.String attribName)
get in class XModelattribName - the field name
public java.lang.String getTagName()
getTagName in class XModelpublic void append(XModel newObject)
append in class XModelnewObject - 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 XModeli - the index of the attribute
public java.lang.String getAttribValueAsString(int i)
getAttribValueAsString in class XModeli - the index of the attribute
public java.lang.String getValueAsString(java.lang.String elementName)
getValueAsString in class XModelelementName - the child element name
public java.lang.String getId()
getId in class XModelpublic java.lang.String getAttribName(int i)
getAttribName in class XModeli - the index of the attribute
public int getAttribute(java.lang.String attribName)
getAttribute in class XModelattribName - The name of the attribute we are trying to locate
public void set(java.lang.String attribName,
java.lang.Object newObject)
set in class XModelattribName - The path to the XModel in the format 'base/foonewObject - The new value of the XModelpublic void set(java.lang.Object s)
set in class XModels - the new valuepublic XModel get(int i)
get in class XModeli - the field index
public java.lang.Object get()
get in class XModelpublic java.lang.Object append(java.lang.String id)
append in class XModelid - the node id
public int getValueAsInt(java.lang.String elementName)
This method is required by the XModel interface but in this case it is not implemented as it is inappropriate in the context of the class
getValueAsInt in class XModelelementName - The name of the element whose value we want
public XModel getValue(int i)
i - the field index
public void setAttribValue(int i,
java.lang.Object value)
setAttribValue in class XModeli - 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 XModeli - 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 XModelpublic int getNumChildren()
getNumChildren in class XModelpublic double getAttribValueAsDouble(int i)
getAttribValueAsDouble in class XModeli - The index of the attributeValues array whose value we want
public int getAttribValueAsInt(int i)
getAttribValueAsInt in class XModeli - The index of the attributeValues array whose value we want
public void remove(XModel node)
This method is required by the XModel 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 | |||||||||