bitronix.tm.utils
Class Scheduler<T>
java.lang.Object
bitronix.tm.utils.Scheduler<T>
- All Implemented Interfaces:
- Iterable<T>
public class Scheduler<T>
- extends Object
- implements Iterable<T>
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
DEFAULT_POSITION
public static final Integer DEFAULT_POSITION
ALWAYS_FIRST_POSITION
public static final Integer ALWAYS_FIRST_POSITION
ALWAYS_LAST_POSITION
public static final Integer ALWAYS_LAST_POSITION
Scheduler
public Scheduler()
add
public void add(T obj,
Integer position)
remove
public void remove(T obj)
getNaturalOrderPositions
public SortedSet<Integer> getNaturalOrderPositions()
getReverseOrderPositions
public SortedSet<Integer> getReverseOrderPositions()
getByNaturalOrderForPosition
public List<T> getByNaturalOrderForPosition(Integer position)
getByReverseOrderForPosition
public List<T> getByReverseOrderForPosition(Integer position)
size
public int size()
iterator
public Iterator<T> iterator()
- Specified by:
iterator
in interface Iterable<T>
reverseIterator
public Iterator<T> reverseIterator()
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2006-2013 Bitronix Software. All Rights Reserved.