FreeHEP API
Version v1.2.2

hep.aida.ref.tuple
Class Tuple

java.lang.Object
  |
  +--hep.aida.ref.event.AIDAObservable
        |
        +--hep.aida.ref.ManagedObject
              |
              +--hep.aida.ref.tuple.AbstractTuple
                    |
                    +--hep.aida.ref.tuple.Tuple
All Implemented Interfaces:
FillableTuple, FTuple, hep.aida.dev.IDevManagedObject, hep.aida.IManagedObject, hep.aida.ITuple

public class Tuple
extends AbstractTuple
implements FTuple, FillableTuple

Author:
The AIDA Team @ SLAC

Field Summary
 
Fields inherited from class hep.aida.ref.ManagedObject
fillable
 
Fields inherited from class hep.aida.ref.event.AIDAObservable
isValid
 
Fields inherited from interface hep.tuple.interfaces.FTuple
ROWS_UNKNOWN
 
Constructor Summary
Tuple(String name, String title, String[] columnName, Class[] columnType, String options)
           
Tuple(String name, String title, String[] columnName, Class[] columnType, String options, FTupleFactory fTupleFactory)
           
Tuple(String name, String title, String columnsString, String options)
           
Tuple(String name, String title, String columnsString, String options, FTupleFactory fTupleFactory)
           
 
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 index)
          Get a TupleColumn
 FTupleColumn columnByName(String name)
          Find the index of a column by name
 String columnDefaultString(int column)
           
 int columnIndexByName(String name)
          Get the index corresponding to a given column.
 double columnMax(int column)
           
 double columnMean(int column)
           
 double columnMin(int column)
           
 String columnName(int param)
          Get the name of a column from its index
 String[] columnNames()
           
 double columnRms(int column)
           
 int columns()
          Get the number of columns in the Tuple
 Class columnType(int param)
          Get the type of a column from its index
 Class[] columnTypes()
           
 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(double[] values)
           
 void fill(float[] values)
           
 void fill(int column, boolean value)
           
 void fill(int column, byte value)
           
 void fill(int column, char value)
           
 void fill(int column, double value)
           
 void fill(int column, float value)
           
 void fill(int column, int value)
           
 void fill(int column, long value)
           
 void fill(int column, Object obj)
           
 void fill(int column, short value)
           
 void fill(int column, String string)
           
 void fill(int column, Value value)
          Fill the stack for a column with String.
 int findColumn(String str)
           
protected  FillableTuple fTuple()
           
 boolean getBoolean(int param)
           
 byte getByte(int param)
           
 char getChar(int param)
           
 String getColString()
           
 double getDouble(int param)
           
 float getFloat(int param)
           
 int getInt(int param)
           
 long getLong(int param)
           
 Object getObject(int param)
           
 String getOptions()
           
 short getShort(int param)
           
 String getString(int param)
           
 hep.aida.ITuple getTuple(int param)
           
protected  void initTuple(String name, String title, String[] columnName, Class[] columnType, String options, FTupleFactory fTupleFactory)
           
protected  void initTuple(String name, String title, String columnsString, String options, FTupleFactory fTupleFactory)
           
protected  void inspectOptions()
           
 boolean isInMemory()
          The purpose of this method is to see if a FTuple would benefit from being buffered in memory for performance issues.
 boolean next()
           
 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.
 int row()
           
 int rows()
          Get the number of rows in the Tuple
 void setRow(int row)
           
 void skip(int rows)
           
 void start()
           
 boolean supportsMultipleCursors()
          Determine if this Tuple supports multiple cursors
 boolean supportsRandomAccess()
          Determine if the cursor returned by getCursor allows random access to the data
 FTuple tuple(int index)
          Get Folder at the current cursor position.
 
Methods inherited from class hep.aida.ref.tuple.AbstractTuple
annotation, getAIDAType, getRow, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, project, setAnnotation, setTitle, title
 
Methods inherited from class hep.aida.ref.ManagedObject
isFillable, name, setFillable, setName
 
Methods inherited from class hep.aida.ref.event.AIDAObservable
addListener, createEvent, fireStateChanged, fireStateChanged, removeListener, setIsValidAfterNotify, setValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hep.tuple.interfaces.FTuple
name, title
 

Constructor Detail

Tuple

public Tuple(String name,
             String title,
             String[] columnName,
             Class[] columnType,
             String options)

Tuple

public Tuple(String name,
             String title,
             String[] columnName,
             Class[] columnType,
             String options,
             FTupleFactory fTupleFactory)

Tuple

public Tuple(String name,
             String title,
             String columnsString,
             String options)

Tuple

public Tuple(String name,
             String title,
             String columnsString,
             String options,
             FTupleFactory fTupleFactory)
Method Detail

initTuple

protected void initTuple(String name,
                         String title,
                         String columnsString,
                         String options,
                         FTupleFactory fTupleFactory)

initTuple

protected void initTuple(String name,
                         String title,
                         String[] columnName,
                         Class[] columnType,
                         String options,
                         FTupleFactory fTupleFactory)

columnDefaultString

public String columnDefaultString(int column)

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.

inspectOptions

protected void inspectOptions()

getOptions

public String getOptions()

getColString

public String getColString()

columnMin

public double columnMin(int column)
Specified by:
columnMin in interface hep.aida.ITuple

columnMax

public double columnMax(int column)
Specified by:
columnMax in interface hep.aida.ITuple

columnMean

public double columnMean(int column)
Specified by:
columnMean in interface hep.aida.ITuple

columnRms

public double columnRms(int column)
Specified by:
columnRms in interface hep.aida.ITuple

findColumn

public int findColumn(String str)
               throws IllegalArgumentException
Specified by:
findColumn in interface hep.aida.ITuple
IllegalArgumentException

getBoolean

public boolean getBoolean(int param)
                   throws ClassCastException
Specified by:
getBoolean in interface hep.aida.ITuple
ClassCastException

getByte

public byte getByte(int param)
             throws ClassCastException
Specified by:
getByte in interface hep.aida.ITuple
ClassCastException

getChar

public char getChar(int param)
             throws ClassCastException
Specified by:
getChar in interface hep.aida.ITuple
ClassCastException

getDouble

public double getDouble(int param)
                 throws ClassCastException
Specified by:
getDouble in interface hep.aida.ITuple
ClassCastException

getFloat

public float getFloat(int param)
               throws ClassCastException
Specified by:
getFloat in interface hep.aida.ITuple
ClassCastException

getInt

public int getInt(int param)
           throws ClassCastException
Specified by:
getInt in interface hep.aida.ITuple
ClassCastException

getLong

public long getLong(int param)
             throws ClassCastException
Specified by:
getLong in interface hep.aida.ITuple
ClassCastException

getObject

public Object getObject(int param)
                 throws ClassCastException
Specified by:
getObject in interface hep.aida.ITuple
ClassCastException

getShort

public short getShort(int param)
               throws ClassCastException
Specified by:
getShort in interface hep.aida.ITuple
ClassCastException

getString

public String getString(int param)
                 throws ClassCastException
Specified by:
getString in interface hep.aida.ITuple
ClassCastException

getTuple

public hep.aida.ITuple getTuple(int param)
Specified by:
getTuple in interface hep.aida.ITuple

fill

public void fill(int column,
                 int value)
          throws IllegalArgumentException
Specified by:
fill in interface hep.aida.ITuple
Overrides:
fill in class AbstractTuple
IllegalArgumentException

fill

public void fill(int column,
                 short value)
          throws IllegalArgumentException
Specified by:
fill in interface hep.aida.ITuple
Overrides:
fill in class AbstractTuple
IllegalArgumentException

fill

public void fill(int column,
                 long value)
          throws IllegalArgumentException
Specified by:
fill in interface hep.aida.ITuple
Overrides:
fill in class AbstractTuple
IllegalArgumentException

fill

public void fill(int column,
                 double value)
          throws IllegalArgumentException
Specified by:
fill in interface hep.aida.ITuple
Overrides:
fill in class AbstractTuple
IllegalArgumentException

fill

public void fill(int column,
                 float value)
          throws IllegalArgumentException
Specified by:
fill in interface hep.aida.ITuple
Overrides:
fill in class AbstractTuple
IllegalArgumentException

fill

public void fill(int column,
                 boolean value)
          throws IllegalArgumentException
Specified by:
fill in interface hep.aida.ITuple
Overrides:
fill in class AbstractTuple
IllegalArgumentException

fill

public void fill(int column,
                 byte value)
          throws IllegalArgumentException
Specified by:
fill in interface hep.aida.ITuple
Overrides:
fill in class AbstractTuple
IllegalArgumentException

fill

public void fill(int column,
                 char value)
          throws IllegalArgumentException
Specified by:
fill in interface hep.aida.ITuple
Overrides:
fill in class AbstractTuple
IllegalArgumentException

fill

public void fill(int column,
                 String string)
          throws IllegalArgumentException
Specified by:
fill in interface hep.aida.ITuple
Overrides:
fill in class AbstractTuple
IllegalArgumentException

fill

public void fill(int column,
                 Object obj)
          throws IllegalArgumentException
Specified by:
fill in interface hep.aida.ITuple
Overrides:
fill in class AbstractTuple
IllegalArgumentException

fill

public void fill(float[] values)
          throws IllegalArgumentException
Specified by:
fill in interface hep.aida.ITuple
Overrides:
fill in class AbstractTuple
IllegalArgumentException

fill

public void fill(double[] values)
          throws IllegalArgumentException
Specified by:
fill in interface hep.aida.ITuple
Overrides:
fill in class AbstractTuple
IllegalArgumentException

row

public int row()

setRow

public void setRow(int row)
Specified by:
setRow in interface hep.aida.ITuple

start

public void start()
Specified by:
start in interface hep.aida.ITuple

skip

public void skip(int rows)
Specified by:
skip in interface hep.aida.ITuple

next

public boolean next()
Specified by:
next in interface hep.aida.ITuple

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
Overrides:
addRow in class AbstractTuple

columnName

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

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

columnNames

public String[] columnNames()
Specified by:
columnNames in interface hep.aida.ITuple
Overrides:
columnNames in class AbstractTuple

columnType

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

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

columnTypes

public Class[] columnTypes()
Specified by:
columnTypes in interface hep.aida.ITuple
Overrides:
columnTypes in class AbstractTuple

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

reset

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

Specified by:
reset in interface FillableTuple
Overrides:
reset in class AbstractTuple

resetRow

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

Specified by:
resetRow in interface FillableTuple
Overrides:
resetRow in class AbstractTuple

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

fTuple

protected FillableTuple fTuple()

addColumn

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

Specified by:
addColumn in interface FillableTuple

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

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

column

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

Specified by:
column in interface FTuple
Parameters:
index - 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.

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.

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.
IllegalStateException

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

removeColumn

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

Specified by:
removeColumn in interface FillableTuple

removeTuple

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

Specified by:
removeTuple in interface FillableTuple

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

tuple

public FTuple tuple(int index)
Description copied from interface: FTuple
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.

FreeHEP API
Version v1.2.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.