FreeHEP API
Version current

hep.tuple
Class Tuple

java.lang.Object
  extended byhep.tuple.Tuple
All Implemented Interfaces:
FillableTuple, FTuple

public class Tuple
extends Object
implements FillableTuple

Author:
The FreeHEP team @ SLAC.
Source Code:
Tuple.java

Field Summary
protected static int COLUMN_ROWS
           
protected  Hashtable columnCounters
           
protected  int columnLength
           
protected  int columnMaxLength
           
protected  int endRow
           
protected  int filledRows
           
protected  ArrayList folderList
           
protected  Map optionMap
           
protected  int startRow
           
protected  ArrayList tupleColumns
           
protected  Value tupleValue
           
 
Fields inherited from interface hep.tuple.interfaces.FTuple
ROWS_UNKNOWN
 
Constructor Summary
protected Tuple(String name, String title)
           
protected Tuple(String name, String title, String options)
           
 
Method Summary
 void addColumn(FillableTupleColumn column)
          Add a new FTupleColumn to the FillableTuple.
 void addRow()
          Should be called after fill is called for the columns.
 void addTuple(FillableTuple tuple)
          When a FillableTuple is added a corresponding FillableTupleColumn with type FillableTuple.class must be added as well!
 void close()
          Free any resources associated with the Tuple (open disk files etc)
 FTupleColumn column(int column)
          Get a TupleColumn
 FTupleColumn columnByName(String name)
          Find the index of a column by name
 int columnIndexByName(String name)
          Get the index corresponding to a given column.
 void columnMaxValue(int column, Value value)
           
 void columnMeanValue(int column, Value value)
           
 void columnMinValue(int column, Value value)
           
 String columnName(int column)
          Get the name of a column from its index
 void columnRmsValue(int column, Value value)
           
 int columns()
          Get the number of columns in the Tuple
 Class columnType(int column)
          Get the type of a column from its index
 void columnValue(int column, FTupleCursor cursor, Value value)
          Get a value stored in the column.
 FTupleCursor cursor()
          Get a cursor for accessing data from the Tuple.
 void fill(int column, Value value)
          Fill the stack for a column with String.
protected  Tuple getFolder(int index, int cursor)
          Get a Folder in a given configuration.
 boolean isInMemory()
          The purpose of this method is to see if a FTuple would benefit from being buffered in memory for performance issues.
 String name()
          Get the name of the Tuple.
 void removeColumn(FillableTupleColumn column)
          Remove a new FTupleColumn to the FillableTuple.
 void removeTuple(FillableTuple tuple)
          Remove the whole FillableTuple.
 void reset()
          Clears all rows from the FillableTuple.
 void resetRow()
          Clears the values on the stack.
 void resetRows(int numberOfRows)
          Clears the values on the stack.
 int rows()
          Get the number of rows in the Tuple
protected  void setStartEndRow(int startRow, int endRow)
          Set the start row.
 int startRow()
          Get the start Point.
 boolean supportsMultipleCursors()
          Determine if this Tuple supports multiple cursors
 boolean supportsRandomAccess()
          Determine if the cursor returned by getCursor allows random access to the data
 String title()
          Get the title of the Tuple.
 FTuple tuple(int index)
          Get Folder at the current cursor position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLUMN_ROWS

protected static final int COLUMN_ROWS
See Also:
Constant Field Values

columnLength

protected int columnLength

columnMaxLength

protected int columnMaxLength

startRow

protected int startRow

endRow

protected int endRow

filledRows

protected int filledRows

optionMap

protected Map optionMap

tupleColumns

protected ArrayList tupleColumns

folderList

protected ArrayList folderList

columnCounters

protected Hashtable columnCounters

tupleValue

protected Value tupleValue
Constructor Detail

Tuple

protected Tuple(String name,
                String title)

Tuple

protected Tuple(String name,
                String title,
                String options)
Method Detail

addColumn

public void addColumn(FillableTupleColumn column)
Description copied from interface: FillableTuple
Add a new FTupleColumn to the FillableTuple.

Specified by:
addColumn in interface FillableTuple

removeColumn

public void removeColumn(FillableTupleColumn column)
Description copied from interface: FillableTuple
Remove a new FTupleColumn to the FillableTuple.

Specified by:
removeColumn in interface FillableTuple

columns

public int columns()
Description copied from interface: FTuple
Get the number of columns in the Tuple

Specified by:
columns in interface FTuple
Returns:
The number of columns

column

public FTupleColumn column(int column)
Description copied from interface: FTuple
Get a TupleColumn

Specified by:
column in interface FTuple
Parameters:
column - The index of the column to return
Returns:
The column at index n

columnByName

public FTupleColumn columnByName(String name)
Description copied from interface: FTuple
Find the index of a column by name

Specified by:
columnByName in interface FTuple
Parameters:
name - The name of the column to search for
Returns:
The named column, or null if no column can be found

columnIndexByName

public int columnIndexByName(String name)
Description copied from interface: FTuple
Get the index corresponding to a given column.

Specified by:
columnIndexByName in interface FTuple
Parameters:
name - The column's name.
Returns:
The index of the corresponding column.

columnName

public String columnName(int column)
Description copied from interface: FTuple
Get the name of a column from its index

Specified by:
columnName in interface FTuple
Parameters:
column - The column's index
Returns:
The column's name

columnType

public Class columnType(int column)
Description copied from interface: FTuple
Get the type of a column from its index

Specified by:
columnType in interface FTuple
Parameters:
column - The column's index
Returns:
The column's type

columnMinValue

public void columnMinValue(int column,
                           Value value)

columnMaxValue

public void columnMaxValue(int column,
                           Value value)

columnMeanValue

public void columnMeanValue(int column,
                            Value value)

columnRmsValue

public void columnRmsValue(int column,
                           Value value)

addRow

public void addRow()
Description copied from interface: FillableTuple
Should be called after fill is called for the columns. Unfilled columns will be filled with the default value for that column.

Specified by:
addRow in interface FillableTuple

resetRow

public void resetRow()
Description copied from interface: FillableTuple
Clears the values on the stack.

Specified by:
resetRow in interface FillableTuple

reset

public void reset()
Description copied from interface: FillableTuple
Clears all rows from the FillableTuple.

Specified by:
reset in interface FillableTuple

rows

public int rows()
Description copied from interface: FTuple
Get the number of rows in the Tuple

Specified by:
rows in interface FTuple
Returns:
The number of rows, or ROWS_UNKNOWN if the number of rows cannot be determined

close

public void close()
Description copied from interface: FTuple
Free any resources associated with the Tuple (open disk files etc)

Specified by:
close in interface FTuple

cursor

public FTupleCursor cursor()
                    throws IllegalStateException
Description copied from interface: FTuple
Get a cursor for accessing data from the Tuple. Some Tuples may support mutliple cursors, others may support only single cursor access.

Specified by:
cursor in interface FTuple
Returns:
A Cursor that can be used to access data from the Tuple columns.
Throws:
IllegalStateException

supportsMultipleCursors

public boolean supportsMultipleCursors()
Description copied from interface: FTuple
Determine if this Tuple supports multiple cursors

Specified by:
supportsMultipleCursors in interface FTuple
Returns:
True if multiple cursors are supported

supportsRandomAccess

public boolean supportsRandomAccess()
Description copied from interface: FTuple
Determine if the cursor returned by getCursor allows random access to the data

Specified by:
supportsRandomAccess in interface FTuple
Returns:
True if random access is supported

title

public String title()
Description copied from interface: FTuple
Get the title of the Tuple.

Specified by:
title in interface FTuple
Returns:
The title of this Tuple

name

public String name()
Description copied from interface: FTuple
Get the name of the Tuple.

Specified by:
name in interface FTuple
Returns:
The name of this Tuple

startRow

public int startRow()
Get the start Point.

Returns:
The start point.

setStartEndRow

protected void setStartEndRow(int startRow,
                              int endRow)
Set the start row.

Parameters:
startRow - The start row.

resetRows

public void resetRows(int numberOfRows)
Clears the values on the stack.


tuple

public FTuple tuple(int index)
Get Folder at the current cursor position.

Specified by:
tuple in interface FTuple
Parameters:
index - The column's index of the Folder.
Returns:
The folder.

getFolder

protected Tuple getFolder(int index,
                          int cursor)
Get a Folder in a given configuration.

Parameters:
index - The column's index for this Folder.
cursor - The cursor position for the Folder.

columnValue

public void columnValue(int column,
                        FTupleCursor cursor,
                        Value value)
Description copied from interface: FTuple
Get a value stored in the column.

Specified by:
columnValue in interface FTuple
Parameters:
column - The column's index.
cursor - The cursor that specifies which value to get.
value - The Value object in which the value is passed.

fill

public void fill(int column,
                 Value value)
Description copied from interface: FillableTuple
Fill the stack for a column with String. If the column has an incompatible type an IllegalArgumentException is thrown.

Specified by:
fill in interface FillableTuple
Parameters:
column - the column's index
value - the value to be stored

addTuple

public void addTuple(FillableTuple tuple)
Description copied from interface: FillableTuple
When a FillableTuple is added a corresponding FillableTupleColumn with type FillableTuple.class must be added as well!

Specified by:
addTuple in interface FillableTuple

removeTuple

public void removeTuple(FillableTuple tuple)
Description copied from interface: FillableTuple
Remove the whole FillableTuple.

Specified by:
removeTuple in interface FillableTuple

isInMemory

public boolean isInMemory()
Description copied from interface: FTuple
The purpose of this method is to see if a FTuple would benefit from being buffered in memory for performance issues.

Specified by:
isInMemory in interface FTuple
Returns:
<\true> if the implementer thinks that the performance would improve by buffering the FTuple in memory.

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.