public class CountingEvent extends PeripheralEvent
CountingEvent class encapsulates pulse counting conditions such as counter terminal value reached or
counting session time interval expired. PulseCounter,
CountingListener| Modifier and Type | Field and Description |
|---|---|
static int |
INTERVAL_EXPIRED
Indicates that the pulse counting time interval has expired.
|
static int |
TERMINAL_VALUE_REACHED
Indicates that the pulse count value has reached the defined terminal value.
|
count, lastTimeStamp, lastTimeStampMicros, peripheral, timeStamp, timeStampMicros| Constructor and Description |
|---|
CountingEvent(PulseCounter counter,
int type,
int value,
long interval)
Creates a new
CountingEvent with the specified type, pulse count value and actual counting time interval
and time-stamped with the current time. |
CountingEvent(PulseCounter counter,
int type,
int value,
long interval,
long timeStamp,
int timeStampMicros)
Creates a new
CountingEvent with the specified type, pulse count value, actual counting time interval and
timestamp. |
| Modifier and Type | Method and Description |
|---|---|
long |
getInterval()
Returns the actual counting time interval (in milliseconds).
|
int |
getType()
Returns the type of counting condition being notified.
|
int |
getValue()
Returns the pulse count value.
|
getCount, getLastTimeStamp, getLastTimeStampMicros, getPeripheral, getTimeStamp, getTimeStampMicrospublic static final int INTERVAL_EXPIRED
public static final int TERMINAL_VALUE_REACHED
public CountingEvent(PulseCounter counter, int type, int value, long interval)
CountingEvent with the specified type, pulse count value and actual counting time interval
and time-stamped with the current time.counter - the source pulse counter.type - the type of counting condition being notified: INTERVAL_EXPIRED or
TERMINAL_VALUE_REACHED.value - the pulse count value.interval - the actual counting time interval (in milliseconds).java.lang.NullPointerException - if counter is null.java.lang.IllegalArgumentException - if type is not one of the defined types or if value or interval is negative.public CountingEvent(PulseCounter counter, int type, int value, long interval, long timeStamp, int timeStampMicros)
CountingEvent with the specified type, pulse count value, actual counting time interval and
timestamp.counter - the source pulse counter.type - the type of counting condition being notified: INTERVAL_EXPIRED or
TERMINAL_VALUE_REACHED.value - the pulse count value.interval - the actual counting time interval (in milliseconds).timeStamp - the timestamp (in milliseconds).timeStampMicros - the additional microseconds to the timestamp.java.lang.NullPointerException - if counter is null.java.lang.IllegalArgumentException - if type is not one of the defined types or if value, interval,
timeStamp or timeStampMicros is negative.public long getInterval()
public int getType()
INTERVAL_EXPIRED or
TERMINAL_VALUE_REACHED..public int getValue()
Copyright (c) 1990, 2013, Oracle and/or its affiliates. All rights reserved.