lejos.localization
Class RangeReadings

java.lang.Object
  extended by lejos.localization.RangeReadings

public class RangeReadings
extends Object

Represents a set of range readings.

Author:
Lawrie Griffiths

WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT.

Field Summary
static float INVALID_READING
           
 
Constructor Summary
RangeReadings(int numReadings)
           
 
Method Summary
 void dumpReadings(DataOutputStream dos)
          Dump the readings to a DataOutputStream
 int getNumReadings()
          Get the number of readings in a set
 float getRange(int i)
          Get a specific range reading
 boolean incomplete()
          Return true if the readings are incomplete
 void loadReadings(DataInputStream dis)
          Load the readings from a DataInputStream
 void setNumReadings(short num)
          Set the number of readings
 void setRange(int i, float range)
          Set a range reading
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVALID_READING

public static final float INVALID_READING
See Also:
Constant Field Values
Constructor Detail

RangeReadings

public RangeReadings(int numReadings)
Method Detail

setRange

public void setRange(int i,
                     float range)
Set a range reading

Parameters:
i - the reading index
range - the range value

getRange

public float getRange(int i)
Get a specific range reading

Parameters:
i - the reading index
Returns:
the range value

incomplete

public boolean incomplete()
Return true if the readings are incomplete

Returns:
true iff one of the readings is not valid

setNumReadings

public void setNumReadings(short num)
Set the number of readings

Parameters:
num - the number of readings

getNumReadings

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


dumpReadings

public void dumpReadings(DataOutputStream dos)
                  throws IOException
Dump the readings to a DataOutputStream

Parameters:
dos - the stream
Throws:
IOException

loadReadings

public void loadReadings(DataInputStream dis)
                  throws IOException
Load the readings from a DataInputStream

Parameters:
dis - the stream
Throws:
IOException