ch.aplu.ftcontroller
Class Counter

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

public class Counter
extends java.lang.Object

Class to handle the eight impulse counters (at ports I1..I8). Each time a connected switch changes its state (closed/opened), the counter value is increased by 1.

To clear all counters use FtController.clearAllCounters().

See Also:
FtController

Method Summary
 Counter clearCount()
          Sets the current count to 0.
 int getCount()
          Polls the counter and returns its current count.
 Counter setCount(int count)
          Sets the current count.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCount

public int getCount()
Polls the counter and returns its current count.

Returns:
the current count

clearCount

public Counter clearCount()
Sets the current count to 0.

Returns:
a reference to the counter to allow chaining

setCount

public Counter setCount(int count)
Sets the current count.

Parameters:
count - the new current count
Returns:
a reference to the counter to allow chaining