com.frinika.contrib.boblang
Class CommandList

java.lang.Object
  extended by com.frinika.contrib.boblang.CommandList

public class CommandList
extends java.lang.Object

Implements a thread safe circular buffer of commands with appropriate notify and time out facilities.

Version:
15 Nov 2002
Author:
Bob Lang

Field Summary
static int NOTE_OFF
           
static int NOTE_ON
           
 
Constructor Summary
CommandList()
          Constructor to create an empty buffer
 
Method Summary
 int[] getCommand()
          Get the next command type and note from the buffer.
 boolean isCommandWaiting(long waitMsecs)
          Return true if a command is waiting in the command buffer
 void putCommand(int type, int note)
          Put a command in the buffer and then notify any waiting tasks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOTE_ON

public static final int NOTE_ON
See Also:
Constant Field Values

NOTE_OFF

public static final int NOTE_OFF
See Also:
Constant Field Values
Constructor Detail

CommandList

public CommandList()
Constructor to create an empty buffer

Method Detail

putCommand

public void putCommand(int type,
                       int note)
Put a command in the buffer and then notify any waiting tasks.


isCommandWaiting

public boolean isCommandWaiting(long waitMsecs)
Return true if a command is waiting in the command buffer


getCommand

public int[] getCommand()
Get the next command type and note from the buffer. It is assumed that waitForCommand has been called prior to this method so that it is known that there is data waiting to be taken