org.sadun.util.tp
Interface Queue


public interface Queue

A simple queue interface for Runnable objects.

This queue may decide the order with which a certain Runnable object may be selected by implementing appropriately the get() method.

Version:
1.0
Author:
C. Sadun

Method Summary
 java.lang.Runnable get()
          Fetch a runnable object from the queue
 boolean isEmpty()
          Return true if the queue is empty
 void put(java.lang.Runnable obj)
          Add a runnable object to the queue
 int size()
          Return the current size of the queue
 

Method Detail

put

public void put(java.lang.Runnable obj)
Add a runnable object to the queue

Parameters:
obj - the runnable to be added to the queue

get

public java.lang.Runnable get()
Fetch a runnable object from the queue


size

public int size()
Return the current size of the queue

Returns:
the current size of the queue

isEmpty

public boolean isEmpty()
Return true if the queue is empty

Returns:
true if the queue is empty