diff options
author | Phil Burk <[email protected]> | 2015-12-14 08:30:37 -0800 |
---|---|---|
committer | Phil Burk <[email protected]> | 2015-12-14 08:32:22 -0800 |
commit | f4e31fd760d364e10648a8a59dd90a0922ef2aa8 (patch) | |
tree | 0ae4d851d0dc48cb45b869e58f196068aadb5f7f /src/com/softsynth/shared/time/ScheduledQueue.java | |
parent | dc2096655c55064b1880121b13e8f3d6f9bf4f30 (diff) |
Add clearCommandQueue() to Synthesizer.
Also make some members final in SynthesisEngine.
Diffstat (limited to 'src/com/softsynth/shared/time/ScheduledQueue.java')
-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(); } |