sjt.mgmt
Interface WorkGroup

All Known Implementing Classes:
LinkedListWorkGroup

public interface WorkGroup

An interface for a work group collection. Used to accomodate switching from various types of collection classes. for example a linked list backed collection in a scalable system expecting massive work loads to an array backed on relying on faster insertions. Uses Objects instead of Runnable in order to accomodate using complex work objects which may include timestamps, priorities, etc.

Since:
0.1

Method Summary
 void addWork(java.lang.Object work)
          Add work to the wrapped collection.
 boolean isEmpty()
          Check whether work has one or more work items in collection.
 java.lang.Object removeWork()
          Remove work from the wrapped collection.The collection itself will decide whether this is FIFO, LIFO, and any other necessary ordering.
 int size()
          Check how many items in work collection.
 

Method Detail

addWork

public void addWork(java.lang.Object work)
Add work to the wrapped collection.
Parameters:
work - A simple of complex work object containing payload, timestamps, priority.

removeWork

public java.lang.Object removeWork()
Remove work from the wrapped collection.The collection itself will decide whether this is FIFO, LIFO, and any other necessary ordering.
Returns:
work of type Object.

size

public int size()
Check how many items in work collection.
Returns:
size of work collection.

isEmpty

public boolean isEmpty()
Check whether work has one or more work items in collection.
Returns:
true or false.