Class OrderedItemContainer<T>


  • public class OrderedItemContainer<T>
    extends Object
    Container for an ordered list of object. Objects are added to the container, and can be sorted and retrieved via getSortedItems(). In order to prevent excessive sorts once the sort has been performed no new objects can be added.

    The sort is guaranteed to be stable, so adding multiple objects with the same priority means that they will be run in the order that they were added.

    Author:
    Stuart Douglas
    • Constructor Detail

      • OrderedItemContainer

        public OrderedItemContainer()
    • Method Detail

      • add

        public void add​(T item,
                        int priority)
      • getSortedItems

        public List<T> getSortedItems()