Class StringArrayLogEntry

java.lang.Object
edu.wpi.first.util.datalog.DataLogEntry
edu.wpi.first.util.datalog.StringArrayLogEntry

public class StringArrayLogEntry extends DataLogEntry
Log array of string values.
  • Field Details

  • Constructor Details

    • StringArrayLogEntry

      public StringArrayLogEntry(DataLog log, String name, String metadata, long timestamp)
      Constructs a string array log entry.
      Parameters:
      log - datalog
      name - name of the entry
      metadata - metadata
      timestamp - entry creation timestamp (0=now)
    • StringArrayLogEntry

      public StringArrayLogEntry(DataLog log, String name, String metadata)
      Constructs a string array log entry.
      Parameters:
      log - datalog
      name - name of the entry
      metadata - metadata
    • StringArrayLogEntry

      public StringArrayLogEntry(DataLog log, String name, long timestamp)
      Constructs a string array log entry.
      Parameters:
      log - datalog
      name - name of the entry
      timestamp - entry creation timestamp (0=now)
    • StringArrayLogEntry

      public StringArrayLogEntry(DataLog log, String name)
      Constructs a string array log entry.
      Parameters:
      log - datalog
      name - name of the entry
  • Method Details

    • append

      public void append(String[] value, long timestamp)
      Appends a record to the log.
      Parameters:
      value - Value to record
      timestamp - Time stamp (0 to indicate now)
    • append

      public void append(String[] value)
      Appends a record to the log.
      Parameters:
      value - Value to record
    • update

      public void update(String[] value, long timestamp)
      Updates the last value and appends a record to the log if it has changed.

      Note: the last value is local to this class instance; using update() with two instances pointing to the same underlying log entry name will likely result in unexpected results.

      Parameters:
      value - Value to record
      timestamp - Time stamp (0 to indicate now)
    • update

      public void update(String[] value)
      Updates the last value and appends a record to the log if it has changed.

      Note: the last value is local to this class instance; using update() with two instances pointing to the same underlying log entry name will likely result in unexpected results.

      Parameters:
      value - Value to record
    • hasLastValue

      public boolean hasLastValue()
      Gets whether there is a last value.

      Note: the last value is local to this class instance and updated only with update(), not append().

      Returns:
      True if last value exists, false otherwise.
    • getLastValue

      public String[] getLastValue()
      Gets the last value.

      Note: the last value is local to this class instance and updated only with update(), not append().

      Returns:
      Last value, or false if none.