From f4e31fd760d364e10648a8a59dd90a0922ef2aa8 Mon Sep 17 00:00:00 2001 From: Phil Burk Date: Mon, 14 Dec 2015 08:30:37 -0800 Subject: Add clearCommandQueue() to Synthesizer. Also make some members final in SynthesisEngine. --- src/com/softsynth/shared/time/ScheduledQueue.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/com/softsynth/shared/time/ScheduledQueue.java') 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 { - private SortedMap> timeNodes; + private final SortedMap> timeNodes; public ScheduledQueue() { timeNodes = new TreeMap>(); @@ -74,6 +74,10 @@ public class ScheduledQueue { return next; } + public synchronized void clear() { + timeNodes.clear(); + } + public TimeStamp getNextTime() { return timeNodes.firstKey(); } -- cgit v1.2.3