public class

DimmingSequence

extends Object
java.lang.Object
   ↳ com.datalogic.extension.selfshopping.led.DimmingSequence

Class Overview

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.

Summary

Constants
int MAX_SIZE Maximum number of sequence points supported.
Public Constructors
DimmingSequence(DimmingSequencePoint[] sequence)
Constructor of a dimming sequence, taking an array of points as parameter.
DimmingSequence()
Empty constructor of a dimming sequence.
Public Methods
void add(DimmingSequencePoint point)
Adds a new point in the sequence.
void clear()
Remove all the points of the sequence.
DimmingSequencePoint getAt(int time)
Retrieves a point given its time value.
DimmingSequencePoint[] getSequenceArray()
Return an array of (time, brightness) pairs that represent the sequence.
void remove(DimmingSequencePoint point)
Removes a point in the sequence.
void removeAt(int time)
Removes a point in the sequence, given the time parameter of the point to remove.
int size()
Return the sequence size.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int MAX_SIZE

Added in revision 2

Maximum number of sequence points supported.

Constant Value: 50 (0x00000032)

Public Constructors

public DimmingSequence (DimmingSequencePoint[] sequence)

Added in revision 2

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.

Parameters
sequence An array of DimmingSequencePoint objects, each representing a (time, brightness) pair in the sequence.
Throws
IllegalArgumentException Exception thrown when the input sequence is invalid.

public DimmingSequence ()

Added in revision 2

Empty constructor of a dimming sequence.

Public Methods

public void add (DimmingSequencePoint point)

Added in revision 2

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.

Parameters
point The point to add.
Throws
IllegalArgumentException If one of the above cases is true.

public void clear ()

Added in revision 2

Remove all the points of the sequence.

public DimmingSequencePoint getAt (int time)

Added in revision 2

Retrieves a point given its time value.

Parameters
time The time value of the point to find.
Returns

public DimmingSequencePoint[] getSequenceArray ()

Added in revision 2

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.

Returns

public void remove (DimmingSequencePoint point)

Added in revision 2

Removes a point in the sequence.

Parameters
point The point to remove. A check both on time and on brightness values is done.

public void removeAt (int time)

Added in revision 2

Removes a point in the sequence, given the time parameter of the point to remove.

Parameters
time The time value of the point to remove.

public int size ()

Added in revision 2

Return the sequence size.

Returns
  • int The number of points in the sequence.