diff options
Diffstat (limited to 'src/com/softsynth')
-rw-r--r-- | src/com/softsynth/shared/time/ScheduledQueue.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/softsynth/shared/time/ScheduledQueue.java b/src/com/softsynth/shared/time/ScheduledQueue.java index d074487..367e4f8 100644 --- a/src/com/softsynth/shared/time/ScheduledQueue.java +++ b/src/com/softsynth/shared/time/ScheduledQueue.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -22,10 +22,10 @@ import java.util.SortedMap; import java.util.TreeMap; /** - * @author Phil Burk, (C) 2009 Mobileer Inc + * Store objects in time sorted order. */ public class ScheduledQueue<T> { - private SortedMap<TimeStamp, List<T>> timeNodes; + private final SortedMap<TimeStamp, List<T>> timeNodes; public ScheduledQueue() { timeNodes = new TreeMap<TimeStamp, List<T>>(); @@ -74,6 +74,10 @@ public class ScheduledQueue<T> { return next; } + public synchronized void clear() { + timeNodes.clear(); + } + public TimeStamp getNextTime() { return timeNodes.firstKey(); } |