Class ShuffleInsertionList<T>

  • Type Parameters:
    T - generic type of elements within the list.
    All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>
    Direct Known Subclasses:
    XFLogImpl, XFTraceImpl

    public class ShuffleInsertionList<T>
    extends java.util.AbstractList<T>
    implements java.lang.Cloneable
    An abstract shuffle insertion list is a list that allows a programmer to hide/add/duplicate elements from the list. It does so by maintaining an array of indices referring either to: 1. the original list 2. a set of "added" elements.
    Author:
    S.J. van Zelst
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected T[] newElements  
      protected int[] positions  
      protected java.util.List<T> source  
      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()  
      T get​(int index)  
      int size()  
      • Methods inherited from class java.util.AbstractList

        add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
      • Methods inherited from class java.util.AbstractCollection

        addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, 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

        addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
    • Field Detail

      • source

        protected java.util.List<T> source
      • positions

        protected int[] positions
      • newElements

        protected T[] newElements
    • Constructor Detail

      • ShuffleInsertionList

        public ShuffleInsertionList​(java.util.List<T> source)
      • ShuffleInsertionList

        public ShuffleInsertionList​(java.util.List<T> source,
                                    int[] elementPositions)
      • ShuffleInsertionList

        public ShuffleInsertionList​(java.util.List<T> source,
                                    java.util.List<T> modifiedOrder)
    • Method Detail

      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<T>
        Specified by:
        size in interface java.util.List<T>
        Specified by:
        size in class java.util.AbstractCollection<T>
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object
      • get

        public T get​(int index)
        Specified by:
        get in interface java.util.List<T>
        Specified by:
        get in class java.util.AbstractList<T>