Enum Class Canandcolor.DataSource
- All Implemented Interfaces:
Serializable
,Comparable<Canandcolor.DataSource>
,Constable
- Enclosing class:
- Canandcolor
Data sources that digout slots can use to perform comparisons or output data directly as a
duty cycle.
All values are typically considered to be scaled between 0.0 and 1.0. For proximity, red,
green, blue, white, and HSV, the values that digout slots consider (and what the Rio would
read if it read the PWM outputs), they are generally equivalent to the values read through
functions like Canandcolor.getProximity()
or Canandcolor.getColor()
.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionBlue readingGreen readingHue readingProximity valueRed readingSaturation readingValue readingWhite reading -
Method Summary
Modifier and TypeMethodDescriptionstatic Canandcolor.DataSource
fromIndex
(int v) Fetches the enum associated with the index value.byte
getIndex()
Returns the associated index number for the enum (used in serialization)static Canandcolor.DataSource
Returns the enum constant of this class with the specified name.static Canandcolor.DataSource[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
kProximity
Proximity value -
kRed
Red reading -
kGreen
Green reading -
kBlue
Blue reading -
kWhite
White reading -
kHue
Hue reading -
kSaturation
Saturation reading -
kValue
Value reading
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
getIndex
public byte getIndex()Returns the associated index number for the enum (used in serialization)- Returns:
- the associated index number for the enum.
-
fromIndex
Fetches the enum associated with the index value.- Parameters:
v
- int containing index value -- if index > max value, the modulo is used- Returns:
- corresponding enum
-