ch.aplu.nxt
Class SensorPort

java.lang.Object
  extended by ch.aplu.nxt.SensorPort

public class SensorPort
extends java.lang.Object

Useful declarations for port connections.


Field Summary
static SensorPort S1
          Declaration used by a sensor connected to port S1.
static SensorPort S2
          Declaration used by a sensor connected to port S2.
static SensorPort S3
          Declaration used by a sensor connected to port S3.
static SensorPort S4
          Declaration used by a sensor connected to port S4.
 
Method Summary
 boolean equals(SensorPort port)
          Compares the labels of the current port to the given port.
 int getId()
          Returns the port identification as integer.
 java.lang.String getLabel()
          Returns the port identification as string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

S1

public static final SensorPort S1
Declaration used by a sensor connected to port S1.


S2

public static final SensorPort S2
Declaration used by a sensor connected to port S2.


S3

public static final SensorPort S3
Declaration used by a sensor connected to port S3.


S4

public static final SensorPort S4
Declaration used by a sensor connected to port S4.

Method Detail

getId

public int getId()
Returns the port identification as integer.

Returns:
port id (number 0..3)

getLabel

public java.lang.String getLabel()
Returns the port identification as string.

Returns:
port id (S1, S2, S3, S4)

equals

public boolean equals(SensorPort port)
Compares the labels of the current port to the given port.

Returns:
true, if both labels match; otherwise false