- java.lang.Object
-
- java.lang.Enum<DigitalState>
-
- com.pi4j.io.gpio.digital.DigitalState
-
- All Implemented Interfaces:
Serializable
,Comparable<DigitalState>
public enum DigitalState extends Enum<DigitalState>
Digital State Enumerations- Version:
- $Id: $Id
- Author:
- Robert Savage (http://www.savagehomeautomation.com)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EnumSet<DigitalState>
all()
all.static DigitalState[]
allStates()
allStates.boolean
equals(boolean state)
equals.boolean
equals(byte state)
equals.boolean
equals(double state)
equals.boolean
equals(float state)
equals.boolean
equals(int state)
equals.boolean
equals(long state)
equals.boolean
equals(short state)
equals.boolean
equals(DigitalState state)
equals.boolean
equals(Number state)
equals.static DigitalState
getInverseState(DigitalState state)
getInverseState.String
getName()
Getter for the fieldname
.static DigitalState
getState(boolean state)
getState.static DigitalState
getState(Number state)
getState.Number
getValue()
Getter for the fieldvalue
.static DigitalState
inverseState(DigitalState state)
inverseState.boolean
isHigh()
isHigh.boolean
isLow()
isLow.static DigitalState
parse(String state)
parse.static DigitalState
state(Number state)
state.String
toString()
Number
value()
value.static DigitalState
valueOf(String name)
Returns the enum constant of this type with the specified name.static DigitalState[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNKNOWN
public static final DigitalState UNKNOWN
-
LOW
public static final DigitalState LOW
-
HIGH
public static final DigitalState HIGH
-
-
Method Detail
-
values
public static DigitalState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DigitalState c : DigitalState.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DigitalState valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isHigh
public boolean isHigh()
isHigh.
- Returns:
- a boolean.
-
isLow
public boolean isLow()
isLow.
- Returns:
- a boolean.
-
equals
public boolean equals(DigitalState state)
equals.
- Parameters:
state
- aDigitalState
object.- Returns:
- a boolean.
-
equals
public boolean equals(Number state)
equals.
- Parameters:
state
- aNumber
object.- Returns:
- a boolean.
-
equals
public boolean equals(boolean state)
equals.
- Parameters:
state
- a boolean.- Returns:
- a boolean.
-
equals
public boolean equals(byte state)
equals.
- Parameters:
state
- a byte.- Returns:
- a boolean.
-
equals
public boolean equals(short state)
equals.
- Parameters:
state
- a short.- Returns:
- a boolean.
-
equals
public boolean equals(int state)
equals.
- Parameters:
state
- a int.- Returns:
- a boolean.
-
equals
public boolean equals(long state)
equals.
- Parameters:
state
- a long.- Returns:
- a boolean.
-
equals
public boolean equals(float state)
equals.
- Parameters:
state
- a float.- Returns:
- a boolean.
-
equals
public boolean equals(double state)
equals.
- Parameters:
state
- a double.- Returns:
- a boolean.
-
toString
public String toString()
- Overrides:
toString
in classEnum<DigitalState>
-
state
public static DigitalState state(Number state)
state.
- Parameters:
state
- aNumber
object.- Returns:
- a
DigitalState
object.
-
getState
public static DigitalState getState(Number state)
getState.
- Parameters:
state
- aNumber
object.- Returns:
- a
DigitalState
object.
-
inverseState
public static DigitalState inverseState(DigitalState state)
inverseState.
- Parameters:
state
- aDigitalState
object.- Returns:
- a
DigitalState
object.
-
getInverseState
public static DigitalState getInverseState(DigitalState state)
getInverseState.
- Parameters:
state
- aDigitalState
object.- Returns:
- a
DigitalState
object.
-
getState
public static DigitalState getState(boolean state)
getState.
- Parameters:
state
- a boolean.- Returns:
- a
DigitalState
object.
-
allStates
public static DigitalState[] allStates()
allStates.
- Returns:
- an array of
DigitalState
objects.
-
all
public static EnumSet<DigitalState> all()
all.
- Returns:
- a
EnumSet
object.
-
parse
public static DigitalState parse(String state)
parse.
- Parameters:
state
- aString
object.- Returns:
- a
DigitalState
object.
-
-