FreeHEP API
Version current

hep.tuple.interfaces
Interface FTuple

All Known Subinterfaces:
FillableTuple
All Known Implementing Classes:
Tuple

public interface FTuple

An interface implemented by all Tuples. This is the minimal interface that a tuple should implement. FTuples can be used with the TupleExplorer

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

Field Summary
static int ROWS_UNKNOWN
           
 
Method Summary
 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
 int columnIndexByName(String name)
          Get the index corresponding to a given column.
 String columnName(int index)
          Get the name of a column from its index
 int columns()
          Get the number of columns in the Tuple
 Class columnType(int index)
          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.
 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.
 int rows()
          Get the number of rows in the Tuple
 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.
 

Field Detail

ROWS_UNKNOWN

public static final int ROWS_UNKNOWN
See Also:
Constant Field Values
Method Detail

title

public String title()
Get the title of the Tuple.

Returns:
The title of this Tuple

name

public String name()
Get the name of the Tuple.

Returns:
The name of this Tuple

columns

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

Returns:
The number of columns

rows

public int rows()
Get the number of rows in the Tuple

Returns:
The number of rows, or ROWS_UNKNOWN if the number of rows cannot be determined

column

public FTupleColumn column(int index)
Get a TupleColumn

Parameters:
index - The index of the column to return
Returns:
The column at index n

columnByName

public FTupleColumn columnByName(String name)
Find the index of a column by name

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)
Get the index corresponding to a given column.

Parameters:
name - The column's name.
Returns:
The index of the corresponding column.

columnName

public String columnName(int index)
Get the name of a column from its index

Parameters:
index - The column's index
Returns:
The column's name

columnType

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

Parameters:
index - The column's index
Returns:
The column's type

columnValue

public void columnValue(int column,
                        FTupleCursor cursor,
                        Value value)
Get a value stored in the column.

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.

tuple

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

Parameters:
index - The column's index of the Folder.
Returns:
The folder.

supportsRandomAccess

public boolean supportsRandomAccess()
Determine if the cursor returned by getCursor allows random access to the data

Returns:
True if random access is supported

supportsMultipleCursors

public boolean supportsMultipleCursors()
Determine if this Tuple supports multiple cursors

Returns:
True if multiple cursors are supported

cursor

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

Returns:
A Cursor that can be used to access data from the Tuple columns.
Throws:
IllegalStateEsxception - If no cursor is currently available
IllegalStateException

close

public void close()
Free any resources associated with the Tuple (open disk files etc)


isInMemory

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

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.