ch.aplu.ftcontroller
Class DigitalEvent

java.lang.Object
  extended by ch.aplu.ftcontroller.DigitalEvent

public class DigitalEvent
extends java.lang.Object

A class to retrieve event information when the DigitalListener callbacks are fired.


Method Summary
 int getMask()
          Returns a bit pattern that reflects which ports have changed their state.
 int getValue()
          Returns a bit pattern that reflects the current states of the input ports: I1->bit 0 (LSB),...
 boolean isPortChanged(int portNb)
          Returns the current state of the given port
 boolean isPortOn(int portNb)
          Returns the state of the given port.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getValue

public int getValue()
Returns a bit pattern that reflects the current states of the input ports: I1->bit 0 (LSB),...,I8->bit 7 (MSB), higher bits set to zero.

Returns:
a bit pattern of the port states (integer 0..255)

getMask

public int getMask()
Returns a bit pattern that reflects which ports have changed their state. I1->bit 0 (LSB),...,I8->bit 7 (MSB), higher bits set to zero.

Returns:
a bit pattern of the ports that changed their state (integer 0..255)

isPortChanged

public boolean isPortChanged(int portNb)
Returns the current state of the given port

Parameters:
portNb - the port number (1..8) to survey for changes
Returns:
true, if the port is set to 1; false, if set to 0

isPortOn

public boolean isPortOn(int portNb)
Returns the state of the given port.

Parameters:
portNb - the port number (1..8) to survey
Returns:
true, if state 1 (on); flase, if the state is 0 (off)