org.drools.guvnor.client.widgets.decoratedgrid
Class CellValue<T extends Comparable<T>>

java.lang.Object
  extended by 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).


Nested Class Summary
static class CellValue.CellState
           
 class CellValue.GroupedCellValue
          A grouped cell, containing a list of grouped cells.
 
Constructor Summary
CellValue(T value, int row, int col)
           
 
Method Summary
 void addState(CellValue.CellState state)
           
 int compareTo(CellValue<T> cv)
           
 CellValue.GroupedCellValue convertToGroupedCell()
          Convert a CellValue into a GroupedCellValue object
 boolean equals(Object obj)
           
 Coordinate getCoordinate()
           
 Coordinate getHtmlCoordinate()
           
 Coordinate getPhysicalCoordinate()
           
 int getRowSpan()
           
 T getValue()
           
 int hashCode()
           
 boolean isEmpty()
           
 boolean isGrouped()
           
 boolean isOtherwise()
           
 boolean isSelected()
           
 void removeState(CellValue.CellState state)
           
 void setCoordinate(Coordinate coordinate)
           
 void setHtmlCoordinate(Coordinate c)
           
 void setPhysicalCoordinate(Coordinate c)
           
 void setRowSpan(int rowSpan)
           
 void setValue(Object value)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellValue

public CellValue(T value,
                 int row,
                 int col)
Method Detail

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-2012 JBoss by Red Hat. All Rights Reserved.