|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.fdsapi.DataSetMap
This class maps DataSets to x,y coordinates. This class is used to add prefixes and suffixes to values in a tabular DataSet (for example a cell or a row). This allows the separation of data (a ResultSet) from presentation (HTML).
You can define the following types of coordinates for DataSets affixes.
1) A DataSet for a particular coordinate (represented by rownumber, columnnumber)
2) A DataSet for a row (x coordinate) default (represented by rownumber, 0)
3) A DataSet for a column (y coordinate) default (represented by 0, columnnumber)
4) An overall default (represented by 0, 0)
For any coordinate being retrieved with getDataSet(x, y) the order of precedence is 1,2,3 then 4. For example if we are displaying the value in coordinate (4,5) of a ResultSet, the following values would be checked to determine what DataSet to use.
1) If (4,5) has an entry then use this value(See the main() method which is used for testing for further details.)
Note the flyweight pattern from the Erich Gamma Design Patterns is used to reduce the number of coordinates that need to be created.
| Constructor Summary | |
protected |
DataSetMap(int maxX,
int maxY)
|
| Method Summary | |
java.lang.Object |
clone()
|
DataSet |
getDataSet(int x,
int y)
Gets the DataSet value for a specific coordinate. |
int |
getMaxX()
|
int |
getMaxY()
|
void |
setDataSet(int x,
int y,
DataSet dataSet)
Associate a DataSet with a specified (x,y) coordinate. |
void |
setDataSetParm(DataSetParm dsp)
Iterate through the map and set the DataSetParms for all DataSets that it contains |
void |
setMaxX(int x)
|
void |
setMaxY(int y)
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected DataSetMap(int maxX,
int maxY)
| Method Detail |
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic void setDataSetParm(DataSetParm dsp)
public void setDataSet(int x,
int y,
DataSet dataSet)
Associate a DataSet with a specified (x,y) coordinate. The getDataSet(x,y) method will return this DataSet.
Sample call:
setAffix(1, 100, "");
setMaxX
public void setMaxX(int x)
setMaxY
public void setMaxY(int y)
getMaxX
public int getMaxX()
getMaxY
public int getMaxY()
getDataSet
public DataSet getDataSet(int x,
int y)
Gets the DataSet value for a specific coordinate.
Sample call:
setDataSet(1, 100, new MyDataSet());
DataSet ds = getDataSet(1, 100);
See the class comment and the main() method to see what happens when a coordinate that is used in the
getDataSet() call doesn't exist.
Overview
Package
Class
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD