FreeHEP API
Version v1.2.2

hep.aida.ref.tuple
Class ChainedTuple

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

public class ChainedTuple
extends AbstractTuple
implements FTuple

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
ChainedTuple(String name, String title, hep.aida.ITuple[] set)
          Tuple constructor.
 
Method Summary
 void addColumn(FTupleColumn column)
           
 void addTuple(FillableTuple tuple)
           
 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)
          Get the maximum value of a column.
 void columnMaxValue(int column, Value value)
           
 double columnMean(int column)
          Get the mean value of a column.
 void columnMeanValue(int column, Value value)
           
 double columnMin(int column)
          Get the minimum value of a column.
 void columnMinValue(int column, Value value)
           
 String columnName(int column)
          Get the name of a column from its index
 String[] columnNames()
           
 double columnRms(int column)
          Get the rms of a column.
 void columnRmsValue(int column, Value value)
           
 int columns()
          Get the number of columns in the Tuple.
 Class columnType(int column)
          Get the type of the 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(int column, Value value)
           
 int findColumn(String name)
          Convert a name to a column index.
 boolean getBoolean(int column)
          Get the column's value corresponding to the cursor's current position.
 byte getByte(int column)
          Get the column's value corresponding to the cursor's current position.
 char getChar(int column)
          Get the column's value corresponding to the cursor's current position.
 double getDouble(int column)
          Get the column's value corresponding to the cursor's current position.
 float getFloat(int column)
          Get the column's value corresponding to the cursor's current position.
 int getInt(int column)
          Get the column's value corresponding to the cursor's current position.
 long getLong(int column)
          Get the column's value corresponding to the cursor's current position.
 Object getObject(int column)
          tupleValue
 int getRow()
          Get the current row.
 short getShort(int column)
          Get the column's value corresponding to the cursor's current position.
 String getString(int column)
          Get the column's value corresponding to the cursor's current position.
 hep.aida.ITuple getTuple(int column)
           
 boolean isInMemory()
          The purpose of this method is to see if a FTuple would benefit from being buffered in memory for performance issues.
static void main(String[] args)
           
 boolean next()
          Positions the cursor at the next row.
 void removeColumn(FTupleColumn column)
           
 void removeTuple(FillableTuple tuple)
           
 int rows()
          The number of rows currently in the ntuple.
 void setRow(int row)
          Set the current row.
 void skip(int rows)
          Skips rows.
 void start()
          Positions the read cursor immediately before the first row.
 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
addRow, annotation, fill, fill, fill, fill, fill, fill, fill, fill, fill, fill, fill, fill, getAIDAType, 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, reset, resetRow, 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

ChainedTuple

public ChainedTuple(String name,
                    String title,
                    hep.aida.ITuple[] set)
Tuple constructor.

Parameters:
name - the Tuple's name
title - the Tuple's title
set - Array of ITuples to be chained
Method Detail

columnDefaultString

public String columnDefaultString(int column)

columns

public int columns()
Get the number of columns in the Tuple.

Specified by:
columns in interface FTuple
Returns:
the number of columns in the Tuple

columnName

public String columnName(int column)
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

columnNames

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

columnType

public Class columnType(int column)
Get the type of the column from its index

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

columnMin

public double columnMin(int column)
Get the minimum value of a column.

Specified by:
columnMin in interface hep.aida.ITuple
Parameters:
column - The column's index.
Returns:
The minimum value of the column. If the minimum cannot be calculated Double.NaN is returned.

columnMax

public double columnMax(int column)
Get the maximum value of a column.

Specified by:
columnMax in interface hep.aida.ITuple
Parameters:
column - The column's index.
Returns:
The maximum value of the column. If the maximum cannot be calculated Double.NaN is returned.

columnMean

public double columnMean(int column)
Get the mean value of a column.

Specified by:
columnMean in interface hep.aida.ITuple
Parameters:
column - The column's index.
Returns:
The mean value of the column. If the mean cannot be calculated Double.NaN is returned.

columnRms

public double columnRms(int column)
Get the rms of a column.

Specified by:
columnRms in interface hep.aida.ITuple
Parameters:
column - The column's index.
Returns:
The rms of the column. If the rms cannot be calculated Double.NaN is returned.

rows

public int rows()
The number of rows currently in the ntuple.

Specified by:
rows in interface FTuple
Returns:
-1 if cannot be determined.

getRow

public int getRow()
Get the current row.

Overrides:
getRow in class AbstractTuple
Returns:
The current row;

getTuple

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

setRow

public void setRow(int row)
Set the current row.

Specified by:
setRow in interface hep.aida.ITuple
Parameters:
row - The current row;
Returns:
True if the opeartion was succesfull.

start

public void start()
Positions the read cursor immediately before the first row.

Specified by:
start in interface hep.aida.ITuple

skip

public void skip(int rows)
Skips rows.

Specified by:
skip in interface hep.aida.ITuple
Parameters:
rows - number of rows to skip, greater than 0.
Returns:
false if it cannot skip rows.

next

public boolean next()
Positions the cursor at the next row.

Specified by:
next in interface hep.aida.ITuple
Returns:
false if there is no next row.

findColumn

public int findColumn(String name)
               throws IllegalArgumentException
Convert a name to a column index. Note: C++ version may return -1 if column not found

Specified by:
findColumn in interface hep.aida.ITuple
Returns:
the column number for a given name
IllegalArgumentException

getInt

public int getInt(int column)
           throws ClassCastException
Get the column's value corresponding to the cursor's current position.

Specified by:
getInt in interface hep.aida.ITuple
Parameters:
column - the column's index
Returns:
the corresponding int value
ClassCastException

getShort

public short getShort(int column)
               throws ClassCastException
Get the column's value corresponding to the cursor's current position.

Specified by:
getShort in interface hep.aida.ITuple
Parameters:
column - the column's index
Returns:
the corresponding short value
ClassCastException

getLong

public long getLong(int column)
             throws ClassCastException
Get the column's value corresponding to the cursor's current position.

Specified by:
getLong in interface hep.aida.ITuple
Parameters:
column - the column's index
Returns:
the corresponding long value
ClassCastException

getFloat

public float getFloat(int column)
               throws ClassCastException
Get the column's value corresponding to the cursor's current position.

Specified by:
getFloat in interface hep.aida.ITuple
Parameters:
column - the column's index
Returns:
the corresponding float value
ClassCastException

getDouble

public double getDouble(int column)
                 throws ClassCastException
Get the column's value corresponding to the cursor's current position.

Specified by:
getDouble in interface hep.aida.ITuple
Parameters:
column - the column's index
Returns:
the corresponding double value
ClassCastException

getBoolean

public boolean getBoolean(int column)
                   throws ClassCastException
Get the column's value corresponding to the cursor's current position.

Specified by:
getBoolean in interface hep.aida.ITuple
Parameters:
column - the column's index
Returns:
the corresponding boolean value
ClassCastException

getByte

public byte getByte(int column)
             throws ClassCastException
Get the column's value corresponding to the cursor's current position.

Specified by:
getByte in interface hep.aida.ITuple
Parameters:
column - the column's index
Returns:
the corresponding byte value
ClassCastException

getChar

public char getChar(int column)
             throws ClassCastException
Get the column's value corresponding to the cursor's current position.

Specified by:
getChar in interface hep.aida.ITuple
Parameters:
column - the column's index
Returns:
the corresponding char
ClassCastException

getString

public String getString(int column)
                 throws ClassCastException
Get the column's value corresponding to the cursor's current position.

Specified by:
getString in interface hep.aida.ITuple
Parameters:
column - the column's index
Returns:
the corresponding String
ClassCastException

getObject

public Object getObject(int column)
                 throws ClassCastException
tupleValue

Specified by:
getObject in interface hep.aida.ITuple
Parameters:
column - the column's index
Returns:
the corresponding Object
ClassCastException

addColumn

public void addColumn(FTupleColumn column)

addTuple

public void addTuple(FillableTuple tuple)

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.

columnMaxValue

public void columnMaxValue(int column,
                           Value value)

columnMeanValue

public void columnMeanValue(int column,
                            Value value)

columnMinValue

public void columnMinValue(int column,
                           Value value)

columnRmsValue

public void columnRmsValue(int column,
                           Value value)

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)

removeColumn

public void removeColumn(FTupleColumn column)

removeTuple

public void removeTuple(FillableTuple tuple)

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.

main

public static void main(String[] args)

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 v1.2.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.