FreeHEP API
Version current

hep.aida.ref.tuple
Class TupleColumn

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

public abstract class TupleColumn
extends Object
implements hep.aida.IBaseTupleColumn, FTupleColumn

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

Nested Class Summary
static class TupleColumn.TupleColumnBoolean
           
static class TupleColumn.TupleColumnByte
           
static class TupleColumn.TupleColumnChar
           
static class TupleColumn.TupleColumnDouble
           
static class TupleColumn.TupleColumnFloat
           
static class TupleColumn.TupleColumnFolder
           
static class TupleColumn.TupleColumnInt
           
static class TupleColumn.TupleColumnLong
           
static class TupleColumn.TupleColumnObject
           
static class TupleColumn.TupleColumnShort
           
static class TupleColumn.TupleColumnString
           
 
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 defaultValue(Value value)
           
 void fill(Value value)
           
protected  Value getDefaultValue()
          Get the column's default value.
 boolean hasDefaultValue()
           
protected abstract  boolean hasStatistics()
          Does this column carry any statistic information?
 double maximum()
           
 void maxValue(Value value)
           
 double mean()
           
 void meanValue(Value value)
           
 double minimum()
           
 void minValue(Value value)
           
 String name()
           
 void reset()
           
 void resetRow()
           
 void resetRows(int numberOfRows)
          Clears the values on the stack.
 double rms()
           
 void rmsValue(Value value)
           
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)
           
 Class type()
           
 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
 

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

minimum

public double minimum()
Specified by:
minimum in interface hep.aida.IBaseTupleColumn

maximum

public double maximum()
Specified by:
maximum in interface hep.aida.IBaseTupleColumn

mean

public double mean()
Specified by:
mean in interface hep.aida.IBaseTupleColumn

rms

public double rms()
Specified by:
rms in interface hep.aida.IBaseTupleColumn

hasDefaultValue

public boolean hasDefaultValue()
Specified by:
hasDefaultValue in interface FTupleColumn

name

public String name()
Specified by:
name in interface hep.aida.IBaseTupleColumn

type

public Class type()
Specified by:
type in interface hep.aida.IBaseTupleColumn

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)

addRow

public void addRow()

resetRow

public void resetRow()

reset

public void reset()

minValue

public void minValue(Value value)
Specified by:
minValue in interface FTupleColumn

maxValue

public void maxValue(Value value)
Specified by:
maxValue in interface FTupleColumn

meanValue

public void meanValue(Value value)
Specified by:
meanValue in interface FTupleColumn

rmsValue

public void rmsValue(Value value)
Specified by:
rmsValue in interface FTupleColumn

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.


defaultValue

public void defaultValue(Value value)
Specified by:
defaultValue in interface FTupleColumn

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.