public interface Blinker
Blinker
provides the means to control an LED or a light that can be illuminated in a
sequenced pattern of colors and durations.Modifier and Type | Interface and Description |
---|---|
static class |
Blinker.Step
Blinker.Step represents a particular color held for a particular length of time. |
Modifier and Type | Method and Description |
---|---|
int |
getBlinkerPatternMaxLength()
Returns the maximum number of
Blinker.Step s that can be present in a pattern |
java.util.Collection<Blinker.Step> |
getPattern()
Returns the current blinking pattern
|
boolean |
patternStackNotEmpty()
Returns whether the pattern stack is currently nonempty.
|
boolean |
popPattern()
Pops the next pattern off of the stack of saved patterns, if any.
|
void |
pushPattern(java.util.Collection<Blinker.Step> steps)
Saves the existing pattern such that it can be later restored, then calls setPattern().
|
void |
setConstant(int color)
Sets the blinker pattern to be a single, unchanging color
|
void |
setPattern(java.util.Collection<Blinker.Step> steps)
Sets the pattern with which this LED or light should illuminate.
|
void |
stopBlinking()
Sets the blinker to constant black and frees any internal resources
|
void setPattern(java.util.Collection<Blinker.Step> steps)
steps
- the pattern of colors and durations that the LED or light should illuminate itself withjava.util.Collection<Blinker.Step> getPattern()
void pushPattern(java.util.Collection<Blinker.Step> steps)
steps
- the new pattern to be displayedboolean patternStackNotEmpty()
boolean popPattern()
void setConstant(int color)
color
- the color with which the LED or light should be illuminatedvoid stopBlinking()
int getBlinkerPatternMaxLength()
Blinker.Step
s that can be present in a patternBlinker.Step
s that can be present in a pattern