FreeHEP API
Version current

hep.tuple
Class TupleColumn

java.lang.Object
  extended byhep.tuple.TupleColumn
All Implemented Interfaces:
FillableTupleColumn, FTupleColumn
Direct Known Subclasses:
TupleColumnBoolean, TupleColumnByte, TupleColumnChar, TupleColumnDate, TupleColumnDouble, TupleColumnFloat, TupleColumnFolder, TupleColumnInt, TupleColumnLong, TupleColumnObject, TupleColumnShort, TupleColumnString

public abstract class TupleColumn
extends Object
implements FillableTupleColumn

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

Field Summary
protected  ArrayList arrayList
           
protected  int arraySize
           
protected  Object currentArray
           
protected  int currentArrayIndex
           
protected  Value defaultValue
          Each TupleColumn should be created with a given size, length = arraySize.
protected  int maximumSize
           
protected  int nStack
           
 
Method Summary
 void addRow()
           
protected abstract  void createArray(int size)
          Create a new array of the appropriate type with given length.
protected abstract  void currentArrayUpdated()
          Update the current array in the column.
 void fill(Value value)
           
protected  Value getDefaultValue()
          Get the column's default value.
 boolean hasDefaultValue()
          Check if the column has a default value.
protected abstract  boolean hasStatistics()
          Does this column carry any statistic information?
 void maxValue(Value value)
          Get the maximum value stored in the column.
 void meanValue(Value value)
          Get the mean value stored in the column.
 void minValue(Value value)
          Get the minimum value stored in the column.
 String name()
          The name of che column.
 void reset()
           
 void resetRow()
           
 void resetRows(int numberOfRows)
          Clears the values on the stack.
 void rmsValue(Value value)
          Get the rms value stored in the column.
protected  void setCurrentArray(int index)
          Set the internal current array to the one corresponding to a given value's index.
protected  void setDefaultValue(Value value)
          Set the column's default value.
abstract  void setValue(int index, Value value)
          Set the value of the column.
 Class type()
          The type of the column.
 void value(FTupleCursor cursor, Value value)
           
abstract  void value(int index, Value value)
           
 
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.FTupleColumn
defaultValue
 

Field Detail

defaultValue

protected Value defaultValue
Each TupleColumn should be created with a given size, length = arraySize. The TupleColumn is divided in three regions: -1- a filled region for permanent storage. -2- a stack region for temporary storage; the value on the stack is not used to calculate min, max, mean and rms. -3- an unfilled region (filled with the default value if provided) At any given time the TupleColumn's configuration should be the following: - there should be nFilled rows with nFilled =< length-2. - there should be a stack region with nStack = nFilled+1. - there can be an unfilled set of rows. A TupleColumn is initialized with the default value. To add data to the stack invoke the fill( value ) method. To commit the stack to the filled region invoke the method addRow(). To reset the stack invoke the method resetRow(). A TupleColumn comes in two flavours: open-ended or close-ended. In the first case the TupleColumn's size is automatically increased by arraySize when needed. In the second case the length of the array is fixed. The default is an open-ended TupleColumn. When creating a new TupleColumn an array of the appropriate type is created with length arraySize.If needed additional arrays of length arraySize are created. All the arrays are stored in an ArrayList to avoid time consuming array copying.


arrayList

protected ArrayList arrayList

arraySize

protected int arraySize

maximumSize

protected int maximumSize

nStack

protected int nStack

currentArray

protected Object currentArray

currentArrayIndex

protected int currentArrayIndex
Method Detail

hasDefaultValue

public boolean hasDefaultValue()
Description copied from interface: FTupleColumn
Check if the column has a default value.

Specified by:
hasDefaultValue in interface FTupleColumn
Returns:
true if the column has a default value.

name

public String name()
Description copied from interface: FTupleColumn
The name of che column.

Specified by:
name in interface FTupleColumn
Returns:
The column's name.

type

public Class type()
Description copied from interface: FTupleColumn
The type of the column. If the column is a folder, i.e. and FTuple, its return type should either be FTuple.class or FillableTuple.class

Specified by:
type in interface FTupleColumn
Returns:
The column's type.

value

public void value(FTupleCursor cursor,
                  Value value)

value

public abstract void value(int index,
                           Value value)

fill

public void fill(Value value)

setValue

public abstract void setValue(int index,
                              Value value)
Description copied from interface: FillableTupleColumn
Set the value of the column. This method should only be used internally; not by the user filling the tuple. The fill() and addRow() methods on the FillableTuple should be used instead.

Specified by:
setValue in interface FillableTupleColumn
Parameters:
index - The position in the FTupleColumn.
value - The Value carrying the value to be set.

addRow

public void addRow()

resetRow

public void resetRow()

reset

public void reset()

minValue

public void minValue(Value value)
Description copied from interface: FTupleColumn
Get the minimum value stored in the column.

Specified by:
minValue in interface FTupleColumn
Parameters:
value - The Value object in which the minimum value is passed.

maxValue

public void maxValue(Value value)
Description copied from interface: FTupleColumn
Get the maximum value stored in the column.

Specified by:
maxValue in interface FTupleColumn
Parameters:
value - The Value object in which the maximum value is passed.

meanValue

public void meanValue(Value value)
Description copied from interface: FTupleColumn
Get the mean value stored in the column.

Specified by:
meanValue in interface FTupleColumn
Parameters:
value - The Value object in which the mean value is passed.

rmsValue

public void rmsValue(Value value)
Description copied from interface: FTupleColumn
Get the rms value stored in the column.

Specified by:
rmsValue in interface FTupleColumn
Parameters:
value - The Value object in which the rms value is passed.

createArray

protected abstract void createArray(int size)
Create a new array of the appropriate type with given length.

Parameters:
size - The size of the array to be created.

getDefaultValue

protected Value getDefaultValue()
Get the column's default value.

Returns:
The default Value.

setDefaultValue

protected void setDefaultValue(Value value)
Set the column's default value.

Parameters:
value - The default value.

hasStatistics

protected abstract boolean hasStatistics()
Does this column carry any statistic information?

Returns:
true if the statistics is updated.

setCurrentArray

protected void setCurrentArray(int index)
Set the internal current array to the one corresponding to a given value's index.

Parameters:
index - The value's index.

currentArrayUpdated

protected abstract void currentArrayUpdated()
Update the current array in the column. This method is invoked within the setCurrentArray( int ) method when the current array is actually changed. The FTupleColumn on which the method is invoked should internally update the current array.


resetRows

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


FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.