|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.fdsapi.DataSet
This class represents a command to be issued gainst TabularData. The command can take any action against the TabularData. The current actions all render text, however the DataSet execute() method is generic and so can execute any command. DataIterator iterates through TabularData executing commands against it vi the DataSet. DataIterator, TabularData, and DataSets together execute the Gang of 4 Iterator and Command design patterns. They are also the most fundamental objects behind the FormattedDataSet.
Template objects contain multiple DataSet's. A DataSet is mapped to a Template tag via Template files/strings. For example you can map a particular DataSet (i.e. command) to a column of the TabularData.
| Field Summary | |
protected DataSetParm |
dataSetParm
|
protected java.lang.String |
templateTagType
|
protected TemplateVariables |
variables
|
| Constructor Summary | |
DataSet()
|
|
| Method Summary | |
java.lang.Object |
clone()
Note clone() returns a shallow copy of the object. |
DataIterator |
createDataIterator()
Iterator factory method |
abstract DataSet |
createFactoryInstance()
A Factory method that creates a clone of this DataSet (see gang of 4 "Factory method" pattern). |
DataSet |
createFactoryInstance(DataSetFactoryParm parm)
A Factory method that creates a clone of this DataSet with whatever data that makes this instance unique . |
java.lang.Object |
execute()
This function should be implemented in DataSetDecorator class for the client program to call to get the process started. |
abstract void |
execute(int y)
Execute a command against the specified index. |
protected java.lang.Object |
getCellData()
|
protected DataSetParm |
getDataSetParm()
Convenience method that gets the DataSetParm object associated with the DataSet. |
protected java.util.Map |
getMiscDataMap()
|
protected java.lang.StringBuffer |
getStringBuffer()
|
protected TabularData |
getTabularData()
Convenience method that gets the underlying TabularData object that the DataSet is working on. |
protected TemplateVariables |
getTemplateVariables()
Convenience method that gets the TemplateVariables object associated with the DataSet. |
protected java.lang.String |
getVariableValue(java.lang.String variableName)
Return the value of a template variable. |
protected void |
initialize(java.lang.String templateContents)
by default does nothing. |
protected void |
log(java.lang.String logStr)
Log to the standard logging device |
boolean |
next()
Increment the underlying TabularData's iterator |
void |
setDataSetParm(DataSetParm dsp)
Method that sets the DataSetParm for the DataSet instance. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected TemplateVariables variables
protected DataSetParm dataSetParm
protected java.lang.String templateTagType
| Constructor Detail |
public DataSet()
| Method Detail |
public boolean next()
public DataSet createFactoryInstance(DataSetFactoryParm parm)
public abstract DataSet createFactoryInstance()
public void setDataSetParm(DataSetParm dsp)
protected void log(java.lang.String logStr)
public DataIterator createDataIterator()
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
Note clone() returns a shallow copy of the object. This means the cloned instance variables of a DataSet will only clone the references not the underlying objects. When instance variables are stateless this works ok, but a deeper copy will have to be implemented if the instance variables are stateful.
This is an implementation of the Prototype factory pattern as discussed in the Erich Gamma Design Patterns book.
The CloneNotSupportedException could only be thrown if this class didn't implement the Cloneable tag interface.
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic abstract void execute(int y)
public java.lang.Object execute()
protected void initialize(java.lang.String templateContents)
protected java.lang.String getVariableValue(java.lang.String variableName)
Return the value of a template variable. It will bring back the variable with any of the dynamic portions populated. For example given the following template variable:
myVariable==##2, ##1
and given the following 2 column row from the tabular data:
Steve SouzaString value=getVariableValue("myVariable"); // value will contain "Souza, Steve"
Note the variable name is case insensitive.
protected TemplateVariables getTemplateVariables()
Convenience method that gets the TemplateVariables object associated with the DataSet.
protected DataSetParm getDataSetParm()
Convenience method that gets the DataSetParm object associated with the DataSet. DataSetParm has contains TabularData and the StringBuffer that is written too among other things. There are other convenience methods that make getting information form DataSetParm more direct.
protected TabularData getTabularData()
Convenience method that gets the underlying TabularData object that the DataSet is working on. There are other convenience methods that make dealing with TabularData objects more direct.
protected java.lang.Object getCellData()
protected java.util.Map getMiscDataMap()
protected java.lang.StringBuffer getStringBuffer()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||