JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.formulae
Class TableReference

java.lang.Object
  |
  +--com.klg.jclass.util.formulae.TableReference
All Implemented Interfaces:
Cloneable, Expression, ExpressionReference

public class TableReference
extends Object
implements ExpressionReference, Cloneable

TableReference selects a single cell from a JCTableDataModel


Field Summary
protected  com.klg.jclass.util.formulae.Expression column
          The column location of the cell in the table
protected  Point location
          A Point identifying the cell location, if it can be computed
protected  com.klg.jclass.util.formulae.Expression row
          The row location of the cell in the table
protected  com.klg.jclass.util.JCTableDataModel tableData
          The table data from which the data is referenced
 
Constructor Summary
TableReference(com.klg.jclass.util.JCTableDataModel tdm, com.klg.jclass.util.formulae.Expression row, com.klg.jclass.util.formulae.Expression column)
          Create a table reference from a table data model and the row/column location of a cell
TableReference(com.klg.jclass.util.JCTableDataModel tdm, int rowNum, int columnNum)
          Create a table value from a table data model and cell co-ordinates
TableReference(com.klg.jclass.util.JCTableDataModel tdm, Point location)
          Create a table value from a table data model and cell location
 
Method Summary
 Object clone()
          Return an Expression which is a clone of this TableReference (NOTE: The referenced table data is not cloned, but if the location contains any parametrized values they are substituted with their current values)
protected  com.klg.jclass.util.formulae.Expression copy(boolean fixLocation)
          Create a copy of this table reference (not necessarily a clone, since we may choose to use hard co-ordinates rather than parametric ones
 boolean equals(Object obj)
          Compare the given object and this TableReference, given that equality implies both objects reference the same entry in the same table.
 com.klg.jclass.util.formulae.Result evaluate()
          Satisfy the Expression interface
 com.klg.jclass.util.formulae.Expression getColumn()
          Get the column coordinate of the referenced cell
 Point getLocation()
          Return the location of the table cell being used by this expression
 com.klg.jclass.util.formulae.Expression getRow()
          Get the row coordinate of the referenced cell
 void setColumn(com.klg.jclass.util.formulae.Expression column)
          Set the column coordinate of the referenced cell
 void setLocation(Point newLocation)
          Set the location of the cell accessed by this expression
 void setRow(com.klg.jclass.util.formulae.Expression row)
          Set the row coordinate of the referenced cell
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tableData

protected com.klg.jclass.util.JCTableDataModel tableData
The table data from which the data is referenced


row

protected com.klg.jclass.util.formulae.Expression row
The row location of the cell in the table


column

protected com.klg.jclass.util.formulae.Expression column
The column location of the cell in the table


location

protected Point location
A Point identifying the cell location, if it can be computed

Constructor Detail

TableReference

public TableReference(com.klg.jclass.util.JCTableDataModel tdm,
                      int rowNum,
                      int columnNum)
Create a table value from a table data model and cell co-ordinates


TableReference

public TableReference(com.klg.jclass.util.JCTableDataModel tdm,
                      Point location)
Create a table value from a table data model and cell location

Parameters:
location - The location of the cell

TableReference

public TableReference(com.klg.jclass.util.JCTableDataModel tdm,
                      com.klg.jclass.util.formulae.Expression row,
                      com.klg.jclass.util.formulae.Expression column)
Create a table reference from a table data model and the row/column location of a cell

Parameters:
row - The row in which the cell appears
column - The column in which the cell appears
Method Detail

evaluate

public com.klg.jclass.util.formulae.Result evaluate()
Satisfy the Expression interface

Specified by:
evaluate in interface Expression
Returns:
This value

clone

public Object clone()
Return an Expression which is a clone of this TableReference (NOTE: The referenced table data is not cloned, but if the location contains any parametrized values they are substituted with their current values)

Specified by:
clone in interface Expression
Overrides:
clone in class Object

getLocation

public Point getLocation()
Return the location of the table cell being used by this expression

Returns:
A Point storing the coordinates of the referenced cell

setLocation

public void setLocation(Point newLocation)
Set the location of the cell accessed by this expression

Parameters:
newLocation - The location of the cell in the table data

getColumn

public com.klg.jclass.util.formulae.Expression getColumn()
Get the column coordinate of the referenced cell

Returns:
The number of the cell's column in the table

setColumn

public void setColumn(com.klg.jclass.util.formulae.Expression column)
Set the column coordinate of the referenced cell

Parameters:
column - The column location of the cell in the table

getRow

public com.klg.jclass.util.formulae.Expression getRow()
Get the row coordinate of the referenced cell

Returns:
The number of the cell's row in the table

setRow

public void setRow(com.klg.jclass.util.formulae.Expression row)
Set the row coordinate of the referenced cell

Parameters:
row - The row location of the cell in the table

equals

public boolean equals(Object obj)
Compare the given object and this TableReference, given that equality implies both objects reference the same entry in the same table.

Overrides:
equals in class Object
Parameters:
obj - the object whose equality with this TableReference is tested
Returns:
True if the object refers to the same object as this TableReference

copy

protected com.klg.jclass.util.formulae.Expression copy(boolean fixLocation)
Create a copy of this table reference (not necessarily a clone, since we may choose to use hard co-ordinates rather than parametric ones

Parameters:
fixLocation - Indicates if the row and column positions are to be evaluated before being set
Returns:
A new TableReference which is a copy of this one (it will point to the same table cell this one currently does

Copyright © 2004 Quest Software Inc..
All rights reserved.