Interface DataBank
- All Known Implementing Classes:
BasicDataBank, EvioDataBank, HipoDataBank
public interface DataBank
-
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) Appends an array to existing array with the same name.voidappendFloat(String path, float[] arr) voidvoidappendLong(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 native array of doubles for given name.doublefloatgetFloat(int element, int index) float[]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 array of doubles into the bank under the name.voidvoidsetFloat(int element, int row, float value) voidvoidvoidsetInt(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.
-
Method Details
-
getColumnList
String[] getColumnList()Get 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.- Returns:
- array of strings with names.
-
getDescriptor
DataDescriptor getDescriptor()Returns the descriptor of the bank, that contains names of the variables and their types.- Returns:
- bank descriptor
-
getDouble
Returns a native array of doubles for given name.- Parameters:
path- - name of the column.- Returns:
- double[] array with values.
-
getDouble
-
getDouble
double getDouble(int element, int index) -
setDouble
Adds array of doubles into the bank under the name.- Parameters:
path- - name of the array.arr- primitive type array of doubles.
-
setDouble
-
setDouble
void setDouble(int element, int row, double value) -
appendDouble
Appends an array to existing array with the same name. The resulting array will increase in size by arr.length.- Parameters:
path- name of the variablearr- primitive type array of doubles.
-
getFloat
-
getFloat
-
getFloat
float getFloat(int element, int index) -
setFloat
-
setFloat
-
setFloat
void setFloat(int element, int row, float value) -
appendFloat
-
getInt
-
getInt
-
getInt
int getInt(int element, int index) -
setInt
-
setInt
-
setInt
void setInt(int element, int row, int value) -
appendInt
-
getShort
-
getShort
-
getShort
short getShort(int element, int index) -
setShort
-
setShort
-
setShort
void setShort(int element, int row, short value) -
appendShort
-
getByte
-
getByte
-
getByte
byte getByte(int element, int index) -
setByte
-
setByte
-
setByte
void setByte(int element, int row, byte value) -
appendByte
-
getLong
-
getLong
-
getLong
long getLong(int element, int index) -
setLong
-
setLong
-
setLong
void setLong(int element, int row, long value) -
appendLong
-
columns
int columns()Returns the number of columns in the bank. columns are number of variables.- Returns:
- number of columns
-
rows
int rows()returns the number of rows in the bank, assuming all columns have the same length.- Returns:
- number of rows
-
show
void show()Prints the content of the bank on the screen. The implementation of printout is left up to the particular implementation of the class. -
reset
void reset()Clears the content of the bank. all columns are removed. -
allocate
void allocate(int rows) Allocates all variables for the the bank. the names are taken from the descriptor object.- Parameters:
rows- number of rows for each column to allocate
-
getTableModel
Returns a table model for displaying the bank information- Parameters:
mask-- Returns:
-