Class DeltaQueue
- java.lang.Object
-
- org.pushingpixels.radiance.theming.extras.internal.tabbed.DeltaQueue
-
public class DeltaQueue extends java.lang.ObjectDelta queue. Follows a standard approach from OS world for efficiently keeping tracks of scheduled events.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDeltaQueue.DeltableBase class for entries in aDeltaQueue.private static classDeltaQueue.DeltableTestTest class.static interfaceDeltaQueue.DeltaMatcherInterface for comparing two delta instances.
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<DeltaQueue.Deltable>queueList of entries.
-
Constructor Summary
Constructors Constructor Description DeltaQueue()Constructs a new empty non-blocking synchronized delta queue.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<DeltaQueue.Deltable>dequeue(int delay)Returns all deltables that have at most specified delay left.voiddump()Dumps the contents of the delta queue.static voidmain(java.lang.String[] args)For testing.voidqueue(DeltaQueue.Deltable deltable)Queues the specified deltable.voidremoveMatching(DeltaQueue.DeltaMatcher matcher)Removes all deltas matching the specified matcher.
-
-
-
Field Detail
-
queue
protected java.util.ArrayList<DeltaQueue.Deltable> queue
List of entries. ContainsDeltaQueue.Deltables.
-
-
Method Detail
-
queue
public void queue(DeltaQueue.Deltable deltable)
Queues the specified deltable. The specified deltable is placed somewhere in the queue based on the initial value of its delta. Note that when this method returns, the value of aDeltaQueue.Deltable.getDelta()may have changed. Do not reuse or change the passed deltable after this method returns.- Parameters:
deltable- Deltable.
-
dequeue
public java.util.List<DeltaQueue.Deltable> dequeue(int delay)
Returns all deltables that have at most specified delay left. The returned list may be empty.- Parameters:
delay- Delay.- Returns:
- The possibly empty list of all deltables that have at most specified delay left.
-
removeMatching
public void removeMatching(DeltaQueue.DeltaMatcher matcher)
Removes all deltas matching the specified matcher.- Parameters:
matcher- Delta matcher.
-
dump
public void dump()
Dumps the contents of the delta queue.
-
main
public static void main(java.lang.String[] args)
For testing.- Parameters:
args- Ignored.
-
-