org.drools.guvnor.client.widgets.decoratedgrid
Class CellValue<T extends Comparable<T>>
java.lang.Object
org.drools.guvnor.client.widgets.decoratedgrid.CellValue<T>
- Type Parameters:
T
- The data-type of the value
- All Implemented Interfaces:
- Comparable<CellValue<T>>
- Direct Known Subclasses:
- CellValue.GroupedCellValue
public class CellValue<T extends Comparable<T>>
- extends Object
- implements Comparable<CellValue<T>>
This is a wrapper around a value. The wrapper provides additional information
required to use the vanilla value in a Decision Table with merge
capabilities.
One coordinate is maintained and two indexes to map to and from HTML table
coordinates. The indexes used to be maintained in SelectionManager however it
required two more N x N collections of "mapping" objects in addition to that
containing the actual data.
The coordinate represents the physical location of the cell on an (R, C)
grid. One index maps the physical coordinate of the cell to the logical
coordinate of the HTML table whilst the other index maps from the logical
coordinate to the physical cell.
For example, given data (0,0), (0,1), (1,0) and (1,1) with cell at (0,0)
merged into (1,0) only the HTML coordinates (0,0), (0,1) and (1,0) exist;
with physical coordinates (0,0) and (1,0) relating to HTML coordinate (0,0)
which has a row span of 2. Therefore physical cells (0,0) and (1,0) have a
mapDataToHtml
coordinate of (0,0) whilst physical cell (1,0) has
a mapHtmlToData
coordinate of (1,1).
Constructor Summary |
CellValue(T value,
int row,
int col)
|
CellValue
public CellValue(T value,
int row,
int col)
addState
public void addState(CellValue.CellState state)
compareTo
public int compareTo(CellValue<T> cv)
- Specified by:
compareTo
in interface Comparable<CellValue<T extends Comparable<T>>>
convertToGroupedCell
public CellValue.GroupedCellValue convertToGroupedCell()
- Convert a CellValue into a GroupedCellValue object
- Returns:
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
getCoordinate
public Coordinate getCoordinate()
getHtmlCoordinate
public Coordinate getHtmlCoordinate()
getPhysicalCoordinate
public Coordinate getPhysicalCoordinate()
getRowSpan
public int getRowSpan()
getValue
public T getValue()
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
isEmpty
public boolean isEmpty()
isGrouped
public boolean isGrouped()
isOtherwise
public boolean isOtherwise()
isSelected
public boolean isSelected()
removeState
public void removeState(CellValue.CellState state)
setCoordinate
public void setCoordinate(Coordinate coordinate)
setHtmlCoordinate
public void setHtmlCoordinate(Coordinate c)
setPhysicalCoordinate
public void setPhysicalCoordinate(Coordinate c)
setRowSpan
public void setRowSpan(int rowSpan)
setValue
public void setValue(Object value)
Copyright © 2001-2011 JBoss Inc.. All Rights Reserved.