Class BasicDataBank

java.lang.Object
org.jlab.io.base.BasicDataBank
All Implemented Interfaces:
DataBank
Direct Known Subclasses:
EvioDataBank

public class BasicDataBank extends Object implements DataBank
Author:
gavalian
  • Constructor Details Link icon

  • Method Details Link icon

    • getColumnList Link icon

      public String[] getColumnList()
      Description copied from interface: DataBank
      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.
      Specified by:
      getColumnList in interface DataBank
      Returns:
      array of strings with names.
    • getDescriptor Link icon

      public DataDescriptor getDescriptor()
      Description copied from interface: DataBank
      Returns the descriptor of the bank, that contains names of the variables and their types.
      Specified by:
      getDescriptor in interface DataBank
      Returns:
      bank descriptor
    • getDouble Link icon

      public double[] getDouble(String path)
      Returns a double array for given column name.
      Specified by:
      getDouble in interface DataBank
      Parameters:
      path - name of the column
      Returns:
      double array
    • setDouble Link icon

      public void setDouble(String path, double[] arr)
      Adds given array to the doubles container. If the array with given column name already exists it will not be replaced.
      Specified by:
      setDouble in interface DataBank
      Parameters:
      path - column name
      arr - array of doubles to add to the container.
    • setDouble Link icon

      public void setDouble(String path, int row, double value)
      Change the value for individual entry for given column. Out of bounds check is performed.
      Specified by:
      setDouble in interface DataBank
      Parameters:
      path - column name
      row - column element
      value - new value to set
    • appendDouble Link icon

      public void appendDouble(String path, double[] arr)
      Not implemented.
      Specified by:
      appendDouble in interface DataBank
      Parameters:
      path -
      arr -
    • getFloat Link icon

      public float[] getFloat(String path)
      Returns a float array for given column name.
      Specified by:
      getFloat in interface DataBank
      Parameters:
      path -
      Returns:
      array of floats
    • setFloat Link icon

      public void setFloat(String path, float[] arr)
      Adds given array to the floats container. If the array with given column name already exists it will not be replaced.
      Specified by:
      setFloat in interface DataBank
      Parameters:
      path -
      arr -
    • setFloat Link icon

      public void setFloat(String path, int row, float value)
      Change the value for individual entry for given column. Out of bounds check is performed.
      Specified by:
      setFloat in interface DataBank
      Parameters:
      path -
      row -
      value -
    • appendFloat Link icon

      public void appendFloat(String path, float[] arr)
      Not implemented.
      Specified by:
      appendFloat in interface DataBank
      Parameters:
      path -
      arr -
    • getInt Link icon

      public int[] getInt(String path)
      Specified by:
      getInt in interface DataBank
    • setInt Link icon

      public void setInt(String path, int[] arr)
      Specified by:
      setInt in interface DataBank
    • setInt Link icon

      public void setInt(String path, int row, int value)
      Specified by:
      setInt in interface DataBank
    • appendInt Link icon

      public void appendInt(String path, int[] arr)
      Not implemented.
      Specified by:
      appendInt in interface DataBank
      Parameters:
      path -
      arr -
    • getShort Link icon

      public short[] getShort(String path)
      Specified by:
      getShort in interface DataBank
    • setShort Link icon

      public void setShort(String path, short[] arr)
      Specified by:
      setShort in interface DataBank
    • setShort Link icon

      public void setShort(String path, int row, short value)
      Specified by:
      setShort in interface DataBank
    • appendShort Link icon

      public void appendShort(String path, short[] arr)
      Specified by:
      appendShort in interface DataBank
    • getByte Link icon

      public byte[] getByte(String path)
      Specified by:
      getByte in interface DataBank
    • setByte Link icon

      public void setByte(String path, byte[] arr)
      Specified by:
      setByte in interface DataBank
    • setByte Link icon

      public void setByte(String path, int row, byte value)
      Specified by:
      setByte in interface DataBank
    • appendByte Link icon

      public void appendByte(String path, byte[] arr)
      Specified by:
      appendByte in interface DataBank
    • getLong Link icon

      public long[] getLong(String path)
      Specified by:
      getLong in interface DataBank
    • setLong Link icon

      public void setLong(String path, long[] arr)
      Specified by:
      setLong in interface DataBank
    • setLong Link icon

      public void setLong(String path, int row, long value)
      Specified by:
      setLong in interface DataBank
    • appendLong Link icon

      public void appendLong(String path, long[] arr)
      Specified by:
      appendLong in interface DataBank
    • columns Link icon

      public int columns()
      Description copied from interface: DataBank
      Returns the number of columns in the bank. columns are number of variables.
      Specified by:
      columns in interface DataBank
      Returns:
      number of columns
    • rows Link icon

      public int rows()
      Description copied from interface: DataBank
      returns the number of rows in the bank, assuming all columns have the same length.
      Specified by:
      rows in interface DataBank
      Returns:
      number of rows
    • show Link icon

      public void show()
      Description copied from interface: DataBank
      Prints the content of the bank on the screen. The implementation of printout is left up to the particular implementation of the class.
      Specified by:
      show in interface DataBank
    • reset Link icon

      public void reset()
      Description copied from interface: DataBank
      Clears the content of the bank. all columns are removed.
      Specified by:
      reset in interface DataBank
    • allocate Link icon

      public void allocate(int rows)
      Description copied from interface: DataBank
      Allocates all variables for the the bank. the names are taken from the descriptor object.
      Specified by:
      allocate in interface DataBank
      Parameters:
      rows - number of rows for each column to allocate
    • getDouble Link icon

      public double getDouble(String path, int index)
      Specified by:
      getDouble in interface DataBank
    • getFloat Link icon

      public float getFloat(String path, int index)
      Specified by:
      getFloat in interface DataBank
    • getInt Link icon

      public int getInt(String path, int index)
      Specified by:
      getInt in interface DataBank
    • getLong Link icon

      public long getLong(String path, int index)
      Specified by:
      getLong in interface DataBank
    • getShort Link icon

      public short getShort(String path, int index)
      Specified by:
      getShort in interface DataBank
    • getByte Link icon

      public byte getByte(String path, int index)
      Specified by:
      getByte in interface DataBank
    • getTableModel Link icon

      public TableModel getTableModel(String mask)
      Description copied from interface: DataBank
      Returns a table model for displaying the bank information
      Specified by:
      getTableModel in interface DataBank
      Parameters:
      mask -
      Returns: