- 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.booleanequals(boolean state)equals.booleanequals(byte state)equals.booleanequals(double state)equals.booleanequals(float state)equals.booleanequals(int state)equals.booleanequals(long state)equals.booleanequals(short state)equals.booleanequals(DigitalState state)equals.booleanequals(Number state)equals.static DigitalStategetInverseState(DigitalState state)getInverseState.StringgetName()Getter for the fieldname.static DigitalStategetState(boolean state)getState.static DigitalStategetState(Number state)getState.NumbergetValue()Getter for the fieldvalue.static DigitalStateinverseState(DigitalState state)inverseState.booleanisHigh()isHigh.booleanisLow()isLow.static DigitalStateparse(String state)parse.static DigitalStatestate(Number state)state.StringtoString()Numbervalue()value.static DigitalStatevalueOf(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- aDigitalStateobject.- Returns:
- a boolean.
-
equals
public boolean equals(Number state)
equals.
- Parameters:
state- aNumberobject.- 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:
toStringin classEnum<DigitalState>
-
state
public static DigitalState state(Number state)
state.
- Parameters:
state- aNumberobject.- Returns:
- a
DigitalStateobject.
-
getState
public static DigitalState getState(Number state)
getState.
- Parameters:
state- aNumberobject.- Returns:
- a
DigitalStateobject.
-
inverseState
public static DigitalState inverseState(DigitalState state)
inverseState.
- Parameters:
state- aDigitalStateobject.- Returns:
- a
DigitalStateobject.
-
getInverseState
public static DigitalState getInverseState(DigitalState state)
getInverseState.
- Parameters:
state- aDigitalStateobject.- Returns:
- a
DigitalStateobject.
-
getState
public static DigitalState getState(boolean state)
getState.
- Parameters:
state- a boolean.- Returns:
- a
DigitalStateobject.
-
allStates
public static DigitalState[] allStates()
allStates.
- Returns:
- an array of
DigitalStateobjects.
-
all
public static EnumSet<DigitalState> all()
all.
- Returns:
- a
EnumSetobject.
-
parse
public static DigitalState parse(String state)
parse.
- Parameters:
state- aStringobject.- Returns:
- a
DigitalStateobject.
-
-