bitronix.tm.utils
Class Scheduler

java.lang.Object
  extended by bitronix.tm.utils.Scheduler

public class Scheduler
extends 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.

Author:
lorban

Field Summary
static int ALWAYS_FIRST_POSITION
           
static Object ALWAYS_FIRST_POSITION_KEY
           
static int ALWAYS_LAST_POSITION
           
static Object ALWAYS_LAST_POSITION_KEY
           
static int DEFAULT_POSITION
           
static Object DEFAULT_POSITION_KEY
           
 
Constructor Summary
Scheduler()
           
 
Method Summary
 void add(Object obj, int position)
           
 List getByNaturalOrderForPosition(Object positionKey)
           
 List getByReverseOrderForPosition(Object positionKey)
           
 SortedSet getNaturalOrderPositions()
           
 SortedSet getReverseOrderPositions()
           
 Iterator iterator()
           
 void remove(Object obj)
           
 Iterator reverseIterator()
           
 int size()
           
 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 Object DEFAULT_POSITION_KEY

ALWAYS_FIRST_POSITION_KEY

public static final Object ALWAYS_FIRST_POSITION_KEY

ALWAYS_LAST_POSITION_KEY

public static final Object ALWAYS_LAST_POSITION_KEY
Constructor Detail

Scheduler

public Scheduler()
Method Detail

add

public void add(Object obj,
                int position)

remove

public void remove(Object obj)

getNaturalOrderPositions

public SortedSet getNaturalOrderPositions()

getReverseOrderPositions

public SortedSet getReverseOrderPositions()

getByNaturalOrderForPosition

public List getByNaturalOrderForPosition(Object positionKey)

getByReverseOrderForPosition

public List getByReverseOrderForPosition(Object positionKey)

size

public int size()

iterator

public Iterator iterator()

reverseIterator

public Iterator reverseIterator()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006-2011 Bitronix Software. All Rights Reserved.