|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<Edge>
nl.lxtreme.ols.api.data.Edge
public enum Edge
Denotes a rising/falling signal edge.
Enum Constant Summary | |
---|---|
FALLING
A falling edge (high -> low transition). |
|
NONE
No edge. |
|
RISING
A rising edge (low -> high transition). |
Method Summary | |
---|---|
Edge |
invert()
Returns the inverse of this edge, so return 'falling' it this is a 'rising' edge, and the other way around. |
boolean |
isFalling()
Returns whether this is a falling edge or not. |
boolean |
isNone()
Returns whether this is not an edge at all. |
boolean |
isRising()
Returns whether this is a rising edge or not. |
static Edge |
toEdge(int aOldValue,
int aNewValue)
Given two (sample) values, determines whether they form a falling, rising or no edge. |
static Edge |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static Edge[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final Edge NONE
public static final Edge RISING
public static final Edge FALLING
Method Detail |
---|
public static Edge[] values()
for (Edge c : Edge.values()) System.out.println(c);
public static Edge valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic static Edge toEdge(int aOldValue, int aNewValue)
If the given "old" value is strictly greater than the given "new" value, this will be considered a falling edge. If the "old" value is strictly less than the "new" value, this will be considered a rising edge. If both values are equal, this means no edge.
aOldValue
- the "old" value;aNewValue
- the "new" value.
null
.public Edge invert()
null
.public boolean isFalling()
true
if this is a falling edge, false
otherwise.public boolean isNone()
true
if this is "no" edge, false
otherwise.public boolean isRising()
true
if this is a rising edge, false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |