Class Measurement


  • public class Measurement
    extends java.lang.Object
    Encodes a single measurement point for RPS.

    Immutable

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int code  
      (package private) Reading r  
      (package private) java.lang.String source  
      (package private) boolean valid  
      (package private) double vsound  
      (package private) double x  
      (package private) double y  
      (package private) double z  
    • Constructor Summary

      Constructors 
      Constructor Description
      Measurement​(Reading r)  
      Measurement​(Reading r, double x, double y, double z, double vsound, int code, java.lang.String source)  
    • Constructor Detail

      • Measurement

        public Measurement​(Reading r,
                           double x,
                           double y,
                           double z,
                           double vsound,
                           int code,
                           java.lang.String source)
    • Method Detail

      • getReading

        public Reading getReading()
        Return the Reading this measurement made from.

        By definition, Reading objects are immutable

        Returns:
        the reading.
      • getId

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

        public double getX()
      • getY

        public double getY()
      • getZ

        public double getZ()
      • getCode

        public int getCode()
        Error code, defined specifically by generator.
        Returns:
        error code.
      • isOkPoint

        public boolean isOkPoint()
        Should this be considered a valid measurement?
        Returns:
        if getCode greater 0.
      • textCode

        public java.lang.String textCode()
        Get the error code as a human-readable string.
        Returns:
        readable error code.
      • getSource

        public java.lang.String getSource()
        Get name of the source.
        Returns:
        source name.
      • toString

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

        double truncate​(double x)