Package 

Class LimitedSortedList

  • All Implemented Interfaces:
    java.io.Serializable , java.lang.Cloneable , java.lang.Iterable , java.util.Collection , java.util.List , java.util.RandomAccess

    
    public class LimitedSortedList<T extends Comparable<T>>
    extends ArrayList<T>
                        

    This class features are: * Supports only types implementing interface < * All new items are automatically added in order based on compareTo * No duplicate items are allowed. (Based on equals method) * Some default ArrayList methods are not supported * Has method that is removing items after they are read cutFirst * All supported methods that write or read should be 'synchronised'; pleas check that method that you are using is synchronised

    • Constructor Summary

      Constructors 
      Constructor Description
      LimitedSortedList(int maxCount)
    • Method Summary

      Modifier and Type Method Description
      synchronized boolean add(T newItem)
      synchronized List<T> cutFirst(int count) Reads first N items and deletes them from array
      synchronized void removeItemThatAreLessThen(T item)
      synchronized boolean isEmpty()
      synchronized int size()
      synchronized void clear()
      void add(int index, T element)
      boolean addAll(Collection<out T> c)
      boolean addAll(int index, Collection<out T> c)
      • Methods inherited from class java.util.ArrayList

        add, add, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
      • Methods inherited from class java.util.AbstractList

        equals, hashCode
      • Methods inherited from class java.util.AbstractCollection

        containsAll, toString
      • Methods inherited from class java.util.Collection

        parallelStream, stream
      • Methods inherited from class java.lang.Iterable

        iterator, spliterator
      • Methods inherited from class java.util.List

        copyOf, of
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait