bitronix.tm.utils
Class Scheduler

java.lang.Object
  extended bybitronix.tm.utils.Scheduler

public class Scheduler
extends java.lang.Object

Positional object container. Objects can be added to a scheduler at a certain position (or priority) and can be retrieved later on in their position + added order. All the objects of a scheduler can be iterated in order or objects of a cetain position can be retrieved for iteration.

© Bitronix Software

Author:
lorban

Field Summary
static int ALWAYS_FIRST_POSITION
           
static java.lang.Object ALWAYS_FIRST_POSITION_KEY
           
static int ALWAYS_LAST_POSITION
           
static java.lang.Object ALWAYS_LAST_POSITION_KEY
           
static int DEFAULT_POSITION
           
static java.lang.Object DEFAULT_POSITION_KEY
           
 
Constructor Summary
Scheduler()
           
 
Method Summary
 void add(java.lang.Object obj, int position)
           
 java.util.List getByNaturalOrderForPosition(java.lang.Object positionKey)
           
 java.util.List getByReverseOrderForPosition(java.lang.Object positionKey)
           
 java.util.SortedSet getNaturalOrderPositions()
           
 java.util.SortedSet getReverseOrderPositions()
           
 java.util.Iterator iterator()
           
 void remove(java.lang.Object obj)
           
 java.util.Iterator reverseIterator()
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_POSITION

public static final int DEFAULT_POSITION
See Also:
Constant Field Values

ALWAYS_FIRST_POSITION

public static final int ALWAYS_FIRST_POSITION
See Also:
Constant Field Values

ALWAYS_LAST_POSITION

public static final int ALWAYS_LAST_POSITION
See Also:
Constant Field Values

DEFAULT_POSITION_KEY

public static final java.lang.Object DEFAULT_POSITION_KEY

ALWAYS_FIRST_POSITION_KEY

public static final java.lang.Object ALWAYS_FIRST_POSITION_KEY

ALWAYS_LAST_POSITION_KEY

public static final java.lang.Object ALWAYS_LAST_POSITION_KEY
Constructor Detail

Scheduler

public Scheduler()
Method Detail

add

public void add(java.lang.Object obj,
                int position)

remove

public void remove(java.lang.Object obj)

getNaturalOrderPositions

public java.util.SortedSet getNaturalOrderPositions()

getReverseOrderPositions

public java.util.SortedSet getReverseOrderPositions()

getByNaturalOrderForPosition

public java.util.List getByNaturalOrderForPosition(java.lang.Object positionKey)

getByReverseOrderForPosition

public java.util.List getByReverseOrderForPosition(java.lang.Object positionKey)

size

public int size()

iterator

public java.util.Iterator iterator()

reverseIterator

public java.util.Iterator reverseIterator()

toString

public java.lang.String toString()