Class AsynchronList<E>

  • Type Parameters:
    E - the type of the list
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.Deque<E>, java.util.List<E>, java.util.Queue<E>

    public final class AsynchronList<E>
    extends java.util.LinkedList<E>
    Asynchronous List implementation to provide a blocking list for the PrimaryDataDirectory.listPrimaryDataEntities() function.
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      AsynchronList()  
      AsynchronList​(java.util.Collection<? extends E> collection)  
    • Method Summary

      Modifier and Type Method Description
      protected void checkAllElementsPresent()  
      protected void checkVolatileElement​(int index)  
      void clear()  
      E get​(int index)  
      int indexOf​(java.lang.Object elem)  
      boolean isEmpty()  
      boolean isStopped()  
      java.util.Iterator<E> iterator()  
      int lastIndexOf​(java.lang.Object o)  
      java.util.ListIterator<E> listIterator()  
      java.util.ListIterator<E> listIterator​(int index)  
      void notifyNewDataAvailable()  
      void notifyNoMoreNewData()  
      E remove​(int index)  
      E set​(int index, E elem)  
      void setStopped()  
      int size()
      beware!!!
      java.lang.Object[] toArray()  
      • Methods inherited from class java.util.LinkedList

        add, add, addAll, addAll, addFirst, addLast, clone, contains, descendingIterator, element, getFirst, getLast, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, spliterator, toArray
      • Methods inherited from class java.util.AbstractList

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

        containsAll, removeAll, retainAll, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        containsAll, equals, hashCode, removeAll, replaceAll, retainAll, sort, subList
    • Constructor Detail

      • AsynchronList

        public AsynchronList()
      • AsynchronList

        public AsynchronList​(java.util.Collection<? extends E> collection)
        Parameters:
        collection - the collection to create AsynchronList
    • Method Detail

      • checkAllElementsPresent

        protected void checkAllElementsPresent()
      • checkVolatileElement

        protected void checkVolatileElement​(int index)
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<E>
        Specified by:
        clear in interface java.util.List<E>
        Overrides:
        clear in class java.util.LinkedList<E>
      • get

        public E get​(int index)
        Specified by:
        get in interface java.util.List<E>
        Overrides:
        get in class java.util.LinkedList<E>
      • indexOf

        public int indexOf​(java.lang.Object elem)
        Specified by:
        indexOf in interface java.util.List<E>
        Overrides:
        indexOf in class java.util.LinkedList<E>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<E>
        Specified by:
        isEmpty in interface java.util.List<E>
        Overrides:
        isEmpty in class java.util.AbstractCollection<E>
      • iterator

        public java.util.Iterator<E> iterator()
        Specified by:
        iterator in interface java.util.Collection<E>
        Specified by:
        iterator in interface java.util.Deque<E>
        Specified by:
        iterator in interface java.lang.Iterable<E>
        Specified by:
        iterator in interface java.util.List<E>
        Overrides:
        iterator in class java.util.AbstractSequentialList<E>
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object o)
        Specified by:
        lastIndexOf in interface java.util.List<E>
        Overrides:
        lastIndexOf in class java.util.LinkedList<E>
      • listIterator

        public java.util.ListIterator<E> listIterator()
        Specified by:
        listIterator in interface java.util.List<E>
        Overrides:
        listIterator in class java.util.AbstractList<E>
      • listIterator

        public java.util.ListIterator<E> listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List<E>
        Overrides:
        listIterator in class java.util.LinkedList<E>
      • notifyNewDataAvailable

        public void notifyNewDataAvailable()
      • notifyNoMoreNewData

        public void notifyNoMoreNewData()
      • remove

        public E remove​(int index)
        Specified by:
        remove in interface java.util.List<E>
        Overrides:
        remove in class java.util.LinkedList<E>
      • set

        public E set​(int index,
                     E elem)
        Specified by:
        set in interface java.util.List<E>
        Overrides:
        set in class java.util.LinkedList<E>
      • size

        public int size()
        beware!!! size is not fixed, can potential increase, use iterator not loop! Otherwise, you will wait until all elements where loaded
        Specified by:
        size in interface java.util.Collection<E>
        Specified by:
        size in interface java.util.Deque<E>
        Specified by:
        size in interface java.util.List<E>
        Overrides:
        size in class java.util.LinkedList<E>
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<E>
        Specified by:
        toArray in interface java.util.List<E>
        Overrides:
        toArray in class java.util.LinkedList<E>
      • isStopped

        public boolean isStopped()
      • setStopped

        public void setStopped()