Class PrioritizedList
- java.lang.Object
-
- com.thoughtworks.xstream.core.util.PrioritizedList
-
public class PrioritizedList extends java.lang.Object
List that allows items to be added with a priority that will affect the order in which they are later iterated over. Objects with a high priority will appear before objects with a low priority in the list. If two objects of the same priority are added to the list, the most recently added one will be iterated over first. Implementation uses a TreeSet, which has a guaranteed add time of O(log(n)).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
PrioritizedList.PrioritizedItem
private static class
PrioritizedList.PrioritizedItemIterator
-
Field Summary
Fields Modifier and Type Field Description private int
lastId
private int
lowestPriority
private java.util.Set
set
-
Constructor Summary
Constructors Constructor Description PrioritizedList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(java.lang.Object item, int priority)
java.util.Iterator
iterator()
-