wiiremotej
Class IRLight

java.lang.Object
  extended by wiiremotej.IRLight

public class IRLight
extends java.lang.Object

A light dot seen by the IR Sensor. IRLights are immutable.


Constructor Summary
IRLight(int x, int y)
          Creates a new IRLight (basic mode) with the given position.
IRLight(int x, int y, int size)
          Creates a new IRLight (extended mode) with the given position and size.
 
Method Summary
 boolean equals(java.lang.Object other)
          Returns true if this IRLight is equivalent to the given IRLight; otherwise false.
 double getSize()
          Returns the size of the light dot from 0 to 1 (percent).
 double getX()
          Returns the X coordinate of the light dot from 0 to 1 (percent).
 double getY()
          Returns the Y coordinate of the light dot from 0 to 1 (percent).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IRLight

public IRLight(int x,
               int y)
Creates a new IRLight (basic mode) with the given position. Size is -1 (this mode doesn't report size).

Parameters:
x - X position of the light (0-1023).
y - Y position of the light (0-767).

IRLight

public IRLight(int x,
               int y,
               int size)
Creates a new IRLight (extended mode) with the given position and size.

Parameters:
x - X position of the light (0-1023).
y - Y position of the light (0-767).
size - size of the light.
Method Detail

getX

public double getX()
Returns the X coordinate of the light dot from 0 to 1 (percent).

Returns:
the X coordinate of the light dot.

getY

public double getY()
Returns the Y coordinate of the light dot from 0 to 1 (percent).

Returns:
the Y coordinate of the light dot.

getSize

public double getSize()
Returns the size of the light dot from 0 to 1 (percent). If this mode doesn't support size, this method returns -1.

Returns:
the size of the light dot.

equals

public boolean equals(java.lang.Object other)
Returns true if this IRLight is equivalent to the given IRLight; otherwise false. Both coordinates and size must match.

Overrides:
equals in class java.lang.Object
Parameters:
other - the other IRLight to compare to.
Returns:
true if this IRLight is equivalent to the given IRLight; otherwise false.