org.displaytag.model
public class: Cell [javadoc |
source]
java.lang.Object
org.displaytag.model.Cell
All Implemented Interfaces:
Cloneable, Comparable
Represents a table cell.
A cell is used only when the content is placed as content of the column tag and need to be evaluated during
iteration.
- author:
Fabrizio - Giustina
- version:
$ - Revision: 1094 $ ($Author: rapruitt $)
| Field Summary |
|---|
| public static final Cell | EMPTY_CELL | empty cell object. Use as placeholder for empty cell to avoid useless object creation. |
| Constructor: |
public Cell(Object value) {
this.staticValue = value;
}
Creates a cell with a static value. Parameters:
value - Object value of the Cell object
|
| Method from org.displaytag.model.Cell Detail: |
public int compareTo(Object obj) {
if (this.staticValue == null)
{
return -1;
}
if (obj instanceof Cell)
{
Object otherStatic = ((Cell) obj).getStaticValue();
if (otherStatic == null)
{
return 1;
}
return ((Comparable) this.staticValue).compareTo(otherStatic);
}
return ((Comparable) this.staticValue).compareTo(obj);
}
Compare the Cell value to another Cell. |
public HtmlAttributeMap getPerRowAttributes() {
return this.attributes;
}
|
public Object getStaticValue() {
return this.staticValue;
}
get the static value for the cell. |
public void setPerRowAttributes(HtmlAttributeMap perRowValues) {
this.attributes = perRowValues;
}
|
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) //
.append("staticValue", this.staticValue).toString(); //$NON-NLS-1$
}
Simple toString wich output the static value. |