Class Reading


  • @Immutable
    public class Reading
    extends java.lang.Object
    Encodes a single set of input values (a "reading") for RPS.

    The values are in time units (nominally usec), and need to be converted to space units during later calculations.

    The values are indexed by Receiver number, as known to the RPS system. For example, getValue(2) will return the time from RPS receiver 2.

    Objects of this class are immutable once created.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.lang.String id  
      (package private) java.lang.Object rawData  
      (package private) int time  
      (package private) double[] values  
    • Constructor Summary

      Constructors 
      Constructor Description
      Reading​(java.lang.String id, double[] values)  
      Reading​(java.lang.String id, double[] values, int time)  
      Reading​(java.lang.String id, double[] values, java.lang.String raw)  
      Reading​(Reading r)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getId()
      Return the ID int of the transmitter this reading describes.
      int getNValues()
      NValues is really the highest receiver number possible.
      java.lang.Object getRawData()
      Get the raw data from which this Reading was made.
      int getTime()
      Return the time at which this Reading was requested.
      double getValue​(int i)
      Convenience method to get a specific one of the values.
      double[] getValues()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • id

        final java.lang.String id
      • values

        final double[] values
      • time

        final int time
      • rawData

        final java.lang.Object rawData
    • Constructor Detail

      • Reading

        public Reading​(java.lang.String id,
                       double[] values)
      • Reading

        public Reading​(java.lang.String id,
                       double[] values,
                       java.lang.String raw)
      • Reading

        public Reading​(java.lang.String id,
                       double[] values,
                       int time)
    • Method Detail

      • getTime

        public int getTime()
        Return the time at which this Reading was requested.
        Returns:
        read request time.
      • getId

        public java.lang.String getId()
        Return the ID int of the transmitter this reading describes.
        Returns:
        ID of the transmitter.
      • getNValues

        public int getNValues()
        NValues is really the highest receiver number possible.
        Returns:
        highest receiver number possible.
      • getValue

        public double getValue​(int i)
        Convenience method to get a specific one of the values.
        Parameters:
        i - value index.
        Returns:
        value.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getRawData

        public java.lang.Object getRawData()
        Get the raw data from which this Reading was made.
        Returns:
        null if raw data was not preserved