Class LogRowArray

  • All Implemented Interfaces:
    LogRow

    public final class LogRowArray
    extends java.lang.Object
    implements LogRow
    One row of log data stored in an array.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int _numStates  
      (package private) long[] _row  
    • Constructor Summary

      Constructors 
      Constructor Description
      LogRowArray​(int numStates)  
      LogRowArray​(long[] row, int numStates)  
      LogRowArray​(java.lang.String rowString)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long[] getData()
      Get a copy of the data as an array of long.
      java.lang.String getDataString()
      Get data as a string of 1's and 0's
      int getNumStates()
      Get the number of states in the row.
      boolean getState​(int index)
      Get the state of one item.
      void setState​(int index, boolean state)
      Get the state of one item.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LogRowArray

        public LogRowArray​(long[] row,
                           int numStates)
      • LogRowArray

        public LogRowArray​(java.lang.String rowString)
    • Method Detail

      • getNumStates

        public int getNumStates()
        Get the number of states in the row.
        Specified by:
        getNumStates in interface LogRow
        Returns:
        the number of states in the row
      • getState

        public boolean getState​(int index)
        Get the state of one item.
        Specified by:
        getState in interface LogRow
        Parameters:
        index - the row index
        Returns:
        true if the state is active
      • setState

        public void setState​(int index,
                             boolean state)
        Get the state of one item.
        Specified by:
        setState in interface LogRow
        Parameters:
        index - the row index
        state - the new state
      • getData

        public long[] getData()
        Get a copy of the data as an array of long. This could be, but don't need to be, the way data is stored internally.
        Specified by:
        getData in interface LogRow
        Returns:
        a clone of the raw data
      • getDataString

        public java.lang.String getDataString()
        Get data as a string of 1's and 0's
        Specified by:
        getDataString in interface LogRow
        Returns:
        the data