java.lang.Object | |
↳ | com.datalogic.extension.selfshopping.led.DimmingSequence |
Class representing a sequence characterized by (time, brightness)
pairs.
The sequence is executed by a dimming LED that interpolates the brightness
between different time values of the sequence. In this way is possible to
have a smooth dimming effect.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | MAX_SIZE | Maximum number of sequence points supported. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor of a dimming sequence, taking an array of points as
parameter.
| |||||||||||
Empty constructor of a dimming sequence.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a new point in the sequence.
| |||||||||||
Remove all the points of the sequence.
| |||||||||||
Retrieves a point given its time value.
| |||||||||||
Return an array of
(time, brightness) pairs that represent the
sequence. | |||||||||||
Removes a point in the sequence.
| |||||||||||
Removes a point in the sequence, given the time parameter of the
point to remove.
| |||||||||||
Return the sequence size.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Maximum number of sequence points supported.
Constructor of a dimming sequence, taking an array of points as
parameter.
The points will be deep copied in the sequence, any change to the
original set will not take effect in the sequence.
Additionally, the input sequence should not be null, contain any
point with the same time value or be larger than MAX_SIZE
.
In any of these cases, an IllegalArgumentException
will be thrown.
sequence | An array of DimmingSequencePoint objects, each
representing a (time, brightness) pair in the sequence. |
---|
IllegalArgumentException | Exception thrown when the input sequence is invalid. |
---|
Adds a new point in the sequence. The new point will be added only if
in the sequence there isn't another point with the same time value
and if the sequence does not exceed MAX_SIZE
after the addition.
If one of these cases is true an IllegalArgumentException
will be thrown.
point | The point to add. |
---|
IllegalArgumentException | If one of the above cases is true. |
---|
Retrieves a point given its time value.
time | The time value of the point to find. |
---|
DimmingSequencePoint
object if found, or null
if not found.
Return an array of (time, brightness)
pairs that represent the
sequence. All points will be a copy of the original, thus any update
to the resulting array will not take effect on the sequence.
DimmingSequencePoint
objects.
Removes a point in the sequence.
point | The point to remove. A check both on time and on brightness values is done. |
---|
Removes a point in the sequence, given the time parameter of the point to remove.
time | The time value of the point to remove. |
---|
Return the sequence size.
int
The number of points in the sequence.