JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.formulae
Class TableExpressionList

java.lang.Object
  |
  +--com.klg.jclass.util.formulae.ExpressionList
        |
        +--com.klg.jclass.util.formulae.TableExpressionList
All Implemented Interfaces:
Cloneable, Collection, Expression, List, Result

public class TableExpressionList
extends ExpressionList

A TableExpressionList represents an examination of a rectangular range of cells stored in a JCTableDataModel


Field Summary
protected  com.klg.jclass.util.formulae.Expression endColumn
          The end column of this expression's range of cells in the data model
protected  com.klg.jclass.util.formulae.Expression endRow
          The end row of this expression's range of cells in the data model
protected  Rectangle range
          A Rectangle describing the range of cells, assuming the expressions can be computed to a final result
protected  com.klg.jclass.util.formulae.Expression startColumn
          The start column of this expression's range of cells in the data model
protected  com.klg.jclass.util.formulae.Expression startRow
          The start row of this expression's range of cells in the data model
protected  com.klg.jclass.util.JCTableDataModel tableData
          The table data from which the data is to be read
 
Constructor Summary
TableExpressionList(com.klg.jclass.util.JCTableDataModel tdm, com.klg.jclass.util.formulae.Expression firstRow, com.klg.jclass.util.formulae.Expression lastRow, com.klg.jclass.util.formulae.Expression firstColumn, com.klg.jclass.util.formulae.Expression lastColumn)
          Create a table expression from a table data model and the row/column locations of a range of cells
TableExpressionList(com.klg.jclass.util.JCTableDataModel tdm, Rectangle range)
          Create a table expression from a table data model and a range of cells
 
Method Summary
 Object clone()
          Return an Expression which is a clone of this TableExpressionList (NOTE: The table values are not cloned and parametrized indices are computed)
 boolean contains(Object obj)
          Determine if the List contain the specified element
protected  com.klg.jclass.util.formulae.Expression copy(boolean fixLocation)
          Create a copy of this TableExpressionList (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 List, given that equality implies the Lists contain the same entries in the same order.
 Object get(int index)
          Retrieve the element at a given position in this List
 com.klg.jclass.util.formulae.Expression getEndColumn()
          Get the last column of the range
 com.klg.jclass.util.formulae.Expression getEndRow()
          Get the last row of the range
 Rectangle getRange()
          Return the range of the table data being used by this expression
 com.klg.jclass.util.formulae.Expression getStartColumn()
          Get the first column of the range
 com.klg.jclass.util.formulae.Expression getStartRow()
          Get the first row of the range
 int hashCode()
          Return a hash code derived from this List
 int indexOf(Object obj)
          Find the position (first occurence) of a given object in the List.
 Iterator iterator()
          Get an iterator over the elements in this List
 int lastIndexOf(Object o)
          Find the position of the last occurence of a given object in the List.
 ListIterator listIterator(int index)
          Get a ListIterator over the elements of the List beginning at the the given position in the list
 void setEndColumn(com.klg.jclass.util.formulae.Expression column)
          Set the last column of the range
 void setEndRow(com.klg.jclass.util.formulae.Expression row)
          Set the last row of the range
 void setRange(Rectangle newRange)
          Set a range of cells to be accessed by this expression
 void setStartColumn(com.klg.jclass.util.formulae.Expression column)
          Set the first column of the range
 void setStartRow(com.klg.jclass.util.formulae.Expression row)
          Set the first row of the range
 int size()
          Return the number of elements in this List
 List subList(int startIndex, int endIndex)
          Get a List which is a subsequence of this List (the ordering is the same)
 Object[] toArray(Object[] inArray)
          Fill a given array with a view of all the elements in this List NOTE: The Iterator's ordering is used
 
Methods inherited from class com.klg.jclass.util.formulae.ExpressionList
add, add, addAll, addAll, clear, containsAll, evaluate, isEmpty, listIterator, remove, remove, removeAll, retainAll, set, toArray
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tableData

protected com.klg.jclass.util.JCTableDataModel tableData
The table data from which the data is to be read


startRow

protected com.klg.jclass.util.formulae.Expression startRow
The start row of this expression's range of cells in the data model


endRow

protected com.klg.jclass.util.formulae.Expression endRow
The end row of this expression's range of cells in the data model


startColumn

protected com.klg.jclass.util.formulae.Expression startColumn
The start column of this expression's range of cells in the data model


endColumn

protected com.klg.jclass.util.formulae.Expression endColumn
The end column of this expression's range of cells in the data model


range

protected Rectangle range
A Rectangle describing the range of cells, assuming the expressions can be computed to a final result

Constructor Detail

TableExpressionList

public TableExpressionList(com.klg.jclass.util.JCTableDataModel tdm,
                           Rectangle range)
Create a table expression from a table data model and a range of cells

Parameters:
range - The (rectangular or linear) range of cells

TableExpressionList

public TableExpressionList(com.klg.jclass.util.JCTableDataModel tdm,
                           com.klg.jclass.util.formulae.Expression firstRow,
                           com.klg.jclass.util.formulae.Expression lastRow,
                           com.klg.jclass.util.formulae.Expression firstColumn,
                           com.klg.jclass.util.formulae.Expression lastColumn)
Create a table expression from a table data model and the row/column locations of a range of cells

Parameters:
firstRow - the first row to be used in the range
lastRow - the last row to be used in the range
firstColumn - the first column to be used in the range
lastColumn - the last column to be used in the range
Method Detail

getRange

public Rectangle getRange()
Return the range of the table data being used by this expression

Returns:
A Rectangle describing the referenced cells of the table data

setRange

public void setRange(Rectangle newRange)
Set a range of cells to be accessed by this expression

Parameters:
newRange - A range of cells in the table data

getStartColumn

public com.klg.jclass.util.formulae.Expression getStartColumn()
Get the first column of the range

Returns:
The number of the first column in the range

setStartColumn

public void setStartColumn(com.klg.jclass.util.formulae.Expression column)
Set the first column of the range

Parameters:
column - The first column in the range

getEndColumn

public com.klg.jclass.util.formulae.Expression getEndColumn()
Get the last column of the range

Returns:
The number of the last column in the range

setEndColumn

public void setEndColumn(com.klg.jclass.util.formulae.Expression column)
Set the last column of the range

Parameters:
column - The last column in the range

getStartRow

public com.klg.jclass.util.formulae.Expression getStartRow()
Get the first row of the range

Returns:
The number of the first row in the range

setStartRow

public void setStartRow(com.klg.jclass.util.formulae.Expression row)
Set the first row of the range

Parameters:
row - The first row in the range

getEndRow

public com.klg.jclass.util.formulae.Expression getEndRow()
Get the last row of the range

Returns:
The number of the last row in the range

setEndRow

public void setEndRow(com.klg.jclass.util.formulae.Expression row)
Set the last row of the range

Parameters:
row - The last row in the range

clone

public Object clone()
Return an Expression which is a clone of this TableExpressionList (NOTE: The table values are not cloned and parametrized indices are computed)

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

contains

public boolean contains(Object obj)
Determine if the List contain the specified element

Specified by:
contains in interface List
Specified by:
contains in class ExpressionList
Parameters:
obj - The element to be searched for in this List
Returns:
True if the List contains the given object

equals

public boolean equals(Object obj)
Compare the given object and this List, given that equality implies the Lists contain the same entries in the same order.

Specified by:
equals in interface List
Specified by:
equals in class ExpressionList
Parameters:
obj - the object whose equality with this List is tested
Returns:
True if the given object satisfies "equality" with this List

get

public Object get(int index)
Retrieve the element at a given position in this List

Specified by:
get in interface List
Specified by:
get in class ExpressionList
Parameters:
index - The desired element's position
Returns:
The element found at the given position

hashCode

public int hashCode()
Return a hash code derived from this List

Specified by:
hashCode in interface List
Overrides:
hashCode in class Object
Returns:
the hash code of this List

indexOf

public int indexOf(Object obj)
Find the position (first occurence) of a given object in the List. -1 is returned if the element is not found in the List.

Specified by:
indexOf in interface List
Specified by:
indexOf in class ExpressionList
Parameters:
obj - The object to be found in the List
Returns:
The location of the object in the List (or -1)

iterator

public Iterator iterator()
Get an iterator over the elements in this List

Specified by:
iterator in interface List
Specified by:
iterator in class ExpressionList
Returns:
an iterator object which enumerates the elements in this List

lastIndexOf

public int lastIndexOf(Object o)
Find the position of the last occurence of a given object in the List. -1 is returned if the element is not found in the List.

Specified by:
lastIndexOf in interface List
Specified by:
lastIndexOf in class ExpressionList
Returns:
The last location the object is found in the List (or -1)

listIterator

public ListIterator listIterator(int index)
Get a ListIterator over the elements of the List beginning at the the given position in the list

Specified by:
listIterator in interface List
Specified by:
listIterator in class ExpressionList
Parameters:
index - The position at which to initialise the ListIterator
Returns:
A ListIterator over this List

size

public int size()
Return the number of elements in this List

Specified by:
size in interface List
Specified by:
size in class ExpressionList
Returns:
the cardinality of this List

subList

public List subList(int startIndex,
                    int endIndex)
Get a List which is a subsequence of this List (the ordering is the same)

Specified by:
subList in interface List
Specified by:
subList in class ExpressionList
Parameters:
startIndex - The first element of the sublist
endIndex - The element after the last element of the sublist
Returns:
A List which contains the elements of the specified subset

toArray

public Object[] toArray(Object[] inArray)
Fill a given array with a view of all the elements in this List NOTE: The Iterator's ordering is used

Specified by:
toArray in interface List
Specified by:
toArray in class ExpressionList
Parameters:
inArray - The array in which to store the elements
Returns:
an Array of all the elements in this List

copy

protected com.klg.jclass.util.formulae.Expression copy(boolean fixLocation)
Create a copy of this TableExpressionList (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 TableExpressionList 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.