public enum Edge extends Enum<Edge>
Enum Constant and Description |
---|
FALLING
A falling edge (high -> low transition).
|
NONE
No edge.
|
RISING
A rising edge (low -> high transition).
|
Modifier and Type | Method and Description |
---|---|
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.
|
public static final Edge NONE
public static final Edge RISING
public static final Edge FALLING
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 nameNullPointerException
- 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.Copyright © 2015 L'Xtreme IT consultancy. All rights reserved.