Class RangeReadings

    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      RangeReadings​(int numReadings)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dumpObject​(java.io.DataOutputStream dos)
      Dump the readings to a DataOutputStream
      float getAngle​(int index)
      Get the angle of a specific reading
      int getNumReadings()
      Get the number of readings in a set
      float getRange​(float angle)
      Get a range reading for a specific angle
      float getRange​(int i)
      Get a specific range reading
      boolean incomplete()
      Return true if the readings are incomplete
      void loadObject​(java.io.DataInputStream dis)
      Load the readings from a DataInputStream
      void printReadings()
      Print the range readings on standard out
      void setRange​(int index, float angle, float range)
      Set the range reading
      • Methods inherited from class java.util.ArrayList

        add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
      • Methods inherited from class java.util.AbstractCollection

        containsAll, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, stream, toArray
      • Methods inherited from interface java.util.List

        containsAll
    • Constructor Detail

      • RangeReadings

        public RangeReadings​(int numReadings)
    • Method Detail

      • getRange

        public float getRange​(int i)
        Get a specific range reading
        Parameters:
        i - the reading index
        Returns:
        the range value
      • getRange

        public float getRange​(float angle)
        Get a range reading for a specific angle
        Parameters:
        angle - the reading angle
        Returns:
        the range value
      • getAngle

        public float getAngle​(int index)
        Get the angle of a specific reading
        Parameters:
        index - the index of the reading
        Returns:
        the angle in degrees
      • incomplete

        public boolean incomplete()
        Return true if the readings are incomplete
        Returns:
        true iff one of the readings is not valid
      • getNumReadings

        public int getNumReadings()
        Get the number of readings in a set
      • setRange

        public void setRange​(int index,
                             float angle,
                             float range)
        Set the range reading
        Parameters:
        index - the index of the reading in the set
        angle - the angle of the reading relative to the robot heading
        range - the range reading
      • dumpObject

        public void dumpObject​(java.io.DataOutputStream dos)
                        throws java.io.IOException
        Dump the readings to a DataOutputStream
        Specified by:
        dumpObject in interface Transmittable
        Parameters:
        dos - the stream
        Throws:
        java.io.IOException
      • loadObject

        public void loadObject​(java.io.DataInputStream dis)
                        throws java.io.IOException
        Load the readings from a DataInputStream
        Specified by:
        loadObject in interface Transmittable
        Parameters:
        dis - the stream
        Throws:
        java.io.IOException
      • printReadings

        public void printReadings()
        Print the range readings on standard out