Package org.jlab.io.base
Class BasicDataBank
java.lang.Object
org.jlab.io.base.BasicDataBank
- All Implemented Interfaces:
DataBank
- Direct Known Subclasses:
EvioDataBank
- Author:
- gavalian
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidallocate(int rows) Allocates all variables for the the bank. the names are taken from the descriptor object.voidappendByte(String path, byte[] arr) voidappendDouble(String path, double[] arr) Not implemented.voidappendFloat(String path, float[] arr) Not implemented.voidNot implemented.voidappendLong(String path, long[] arr) voidappendShort(String path, short[] arr) intcolumns()Returns the number of columns in the bank. columns are number of variables.bytegetByte(int element, int index) byte[]byteString[]Get the names of the columns in the bank.Returns the descriptor of the bank, that contains names of the variables and their types.doublegetDouble(int element, int index) double[]Returns a double array for given column name.doublefloatgetFloat(int element, int index) float[]Returns a float array for given column name.floatintgetInt(int element, int index) int[]intlonggetLong(int element, int index) long[]longshortgetShort(int element, int index) short[]shortgetTableModel(String mask) Returns a table model for displaying the bank informationvoidreset()Clears the content of the bank. all columns are removed.introws()returns the number of rows in the bank, assuming all columns have the same length.voidsetByte(int element, int row, byte value) voidvoidvoidsetDouble(int element, int row, double value) voidAdds given array to the doubles container.voidChange the value for individual entry for given column.voidsetFloat(int element, int row, float value) voidAdds given array to the floats container.voidChange the value for individual entry for given column.voidsetInt(int element, int row, int value) voidvoidvoidsetLong(int element, int row, long value) voidvoidvoidsetShort(int element, int row, short value) voidvoidvoidshow()Prints the content of the bank on the screen.
-
Constructor Details
-
BasicDataBank
-
-
Method Details
-
getColumnList
Description copied from interface:DataBankGet the names of the columns in the bank. The name is used in the calls getInt() and getDouble() and other calls for get the arrays.- Specified by:
getColumnListin interfaceDataBank- Returns:
- array of strings with names.
-
getDescriptor
Description copied from interface:DataBankReturns the descriptor of the bank, that contains names of the variables and their types.- Specified by:
getDescriptorin interfaceDataBank- Returns:
- bank descriptor
-
getDouble
Returns a double array for given column name. -
setDouble
Adds given array to the doubles container. If the array with given column name already exists it will not be replaced. -
setDouble
Change the value for individual entry for given column. Out of bounds check is performed. -
appendDouble
Not implemented.- Specified by:
appendDoublein interfaceDataBank- Parameters:
path-arr-
-
getFloat
Returns a float array for given column name. -
setFloat
Adds given array to the floats container. If the array with given column name already exists it will not be replaced. -
setFloat
Change the value for individual entry for given column. Out of bounds check is performed. -
appendFloat
Not implemented.- Specified by:
appendFloatin interfaceDataBank- Parameters:
path-arr-
-
getInt
-
setInt
-
setInt
-
appendInt
Not implemented. -
getShort
-
setShort
-
setShort
-
appendShort
- Specified by:
appendShortin interfaceDataBank
-
getByte
-
setByte
-
setByte
-
appendByte
- Specified by:
appendBytein interfaceDataBank
-
getLong
-
setLong
-
setLong
-
appendLong
- Specified by:
appendLongin interfaceDataBank
-
columns
public int columns()Description copied from interface:DataBankReturns the number of columns in the bank. columns are number of variables. -
rows
public int rows()Description copied from interface:DataBankreturns the number of rows in the bank, assuming all columns have the same length. -
show
public void show()Description copied from interface:DataBankPrints the content of the bank on the screen. The implementation of printout is left up to the particular implementation of the class. -
reset
public void reset()Description copied from interface:DataBankClears the content of the bank. all columns are removed. -
allocate
public void allocate(int rows) Description copied from interface:DataBankAllocates all variables for the the bank. the names are taken from the descriptor object. -
getDouble
-
getFloat
-
getInt
-
getLong
-
getShort
-
getByte
-
getTableModel
Description copied from interface:DataBankReturns a table model for displaying the bank information- Specified by:
getTableModelin interfaceDataBank- Parameters:
mask-- Returns:
-
getDouble
public double getDouble(int element, int index) -
setDouble
public void setDouble(int element, int row, double value) -
getFloat
public float getFloat(int element, int index) -
setFloat
public void setFloat(int element, int row, float value) -
getInt
public int getInt(int element, int index) -
setInt
public void setInt(int element, int row, int value) -
getShort
public short getShort(int element, int index) -
setShort
public void setShort(int element, int row, short value) -
getByte
public byte getByte(int element, int index) -
setByte
public void setByte(int element, int row, byte value) -
getLong
public long getLong(int element, int index) -
setLong
public void setLong(int element, int row, long value)
-