Class RecordBuffer


public class RecordBuffer extends DataEndpoint
Collects the records that share one key in a BufferedReader; they can be read back only after the buffer is closed.
  • Constructor Details

  • Method Details

    • getKey

      public CompositeValue getKey()
    • getUpdatedOn

      public long getUpdatedOn()
      Returns the time (milliseconds since the epoch) the last record was added or 0 if none were.
    • getRecords

      public RecordList getRecords()
    • addExceptionProperties

      public DataException addExceptionProperties(DataException exception)
      Description copied from class: Endpoint
      Adds this endpoint's current state to a DataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.
      Overrides:
      addExceptionProperties in class DataEndpoint
    • add

      public void add(Record record)
      Appends the record and updates the last-added time; only allowed while the buffer is open.
    • open

      public void open() throws DataException
      Description copied from class: DataEndpoint
      Makes this endpoint ready for reading or writing.
      Overrides:
      open in class DataEndpoint
      Throws:
      DataException
    • close

      public void close() throws DataException
      Description copied from class: DataEndpoint
      Indicates that this endpoint has finished reading or writing.
      Overrides:
      close in class DataEndpoint
      Throws:
      DataException
    • nextRecord

      public Record nextRecord()
      Returns the next collected record or null when none remain; only allowed after the buffer is closed.