Class FastList<E>

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>

    public class FastList<E>
    extends java.util.AbstractList<E>
    implements java.io.Externalizable
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private E[] elements  
      private int size  
      private boolean updated  
      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      FastList()  
      FastList​(int size)  
      FastList​(E[] elements)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int i, E o)  
      boolean add​(E o)  
      boolean addAll​(int i, java.util.Collection<? extends E> collection)  
      boolean addAll​(java.util.Collection collection)  
      void clear()  
      boolean contains​(java.lang.Object o)  
      boolean containsAll​(java.util.Collection collection)  
      private void copyArray()  
      private void ensureCapacity​(int additional)  
      boolean equals​(java.lang.Object o)  
      E get​(int index)  
      int hashCode()  
      private void increaseSize​(int newSize)  
      int indexOf​(java.lang.Object o)  
      boolean isEmpty()  
      java.util.Iterator iterator()  
      int lastIndexOf​(java.lang.Object o)  
      java.util.ListIterator<E> listIterator()  
      java.util.ListIterator listIterator​(int i)  
      void readExternal​(java.io.ObjectInput in)  
      E remove​(int i)  
      boolean remove​(java.lang.Object o)  
      boolean removeAll​(java.util.Collection collection)  
      protected void removeRange​(int i, int i1)  
      boolean retainAll​(java.util.Collection collection)  
      E set​(int i, E o)  
      int size()  
      java.util.List subList​(int i, int i1)  
      java.lang.Object[] toArray()  
      java.lang.Object[] toArray​(java.lang.Object[] objects)  
      java.lang.String toString()  
      void writeExternal​(java.io.ObjectOutput out)  
      • Methods inherited from class java.lang.Object

        clone, 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

        replaceAll, sort, spliterator
    • Field Detail

      • elements

        private E[] elements
      • size

        private int size
      • updated

        private boolean updated
    • Constructor Detail

      • FastList

        public FastList​(int size)
      • FastList

        public FastList​(E[] elements)
      • FastList

        public FastList()
    • Method Detail

      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • get

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

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

        public boolean add​(E o)
        Specified by:
        add in interface java.util.Collection<E>
        Specified by:
        add in interface java.util.List<E>
        Overrides:
        add in class java.util.AbstractList<E>
      • set

        public E set​(int i,
                     E o)
        Specified by:
        set in interface java.util.List<E>
        Overrides:
        set in class java.util.AbstractList<E>
      • add

        public void add​(int i,
                        E o)
        Specified by:
        add in interface java.util.List<E>
        Overrides:
        add in class java.util.AbstractList<E>
      • remove

        public E remove​(int i)
        Specified by:
        remove in interface java.util.List<E>
        Overrides:
        remove in class java.util.AbstractList<E>
      • indexOf

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

        public int lastIndexOf​(java.lang.Object o)
        Specified by:
        lastIndexOf in interface java.util.List<E>
        Overrides:
        lastIndexOf in class java.util.AbstractList<E>
      • 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.AbstractList<E>
      • addAll

        public boolean addAll​(int i,
                              java.util.Collection<? extends E> collection)
        Specified by:
        addAll in interface java.util.List<E>
        Overrides:
        addAll in class java.util.AbstractList<E>
      • iterator

        public java.util.Iterator iterator()
        Specified by:
        iterator in interface java.util.Collection<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.AbstractList<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 listIterator​(int i)
        Specified by:
        listIterator in interface java.util.List<E>
        Overrides:
        listIterator in class java.util.AbstractList<E>
      • subList

        public java.util.List subList​(int i,
                                      int i1)
        Specified by:
        subList in interface java.util.List<E>
        Overrides:
        subList in class java.util.AbstractList<E>
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Collection<E>
        Specified by:
        equals in interface java.util.List<E>
        Overrides:
        equals in class java.util.AbstractList<E>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Collection<E>
        Specified by:
        hashCode in interface java.util.List<E>
        Overrides:
        hashCode in class java.util.AbstractList<E>
      • removeRange

        protected void removeRange​(int i,
                                   int i1)
        Overrides:
        removeRange in class java.util.AbstractList<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>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<E>
        Specified by:
        contains in interface java.util.List<E>
        Overrides:
        contains in class java.util.AbstractCollection<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.AbstractCollection<E>
      • toArray

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

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<E>
        Specified by:
        remove in interface java.util.List<E>
        Overrides:
        remove in class java.util.AbstractCollection<E>
      • containsAll

        public boolean containsAll​(java.util.Collection collection)
        Specified by:
        containsAll in interface java.util.Collection<E>
        Specified by:
        containsAll in interface java.util.List<E>
        Overrides:
        containsAll in class java.util.AbstractCollection<E>
      • addAll

        public boolean addAll​(java.util.Collection collection)
        Specified by:
        addAll in interface java.util.Collection<E>
        Specified by:
        addAll in interface java.util.List<E>
        Overrides:
        addAll in class java.util.AbstractCollection<E>
      • removeAll

        public boolean removeAll​(java.util.Collection collection)
        Specified by:
        removeAll in interface java.util.Collection<E>
        Specified by:
        removeAll in interface java.util.List<E>
        Overrides:
        removeAll in class java.util.AbstractCollection<E>
      • retainAll

        public boolean retainAll​(java.util.Collection collection)
        Specified by:
        retainAll in interface java.util.Collection<E>
        Specified by:
        retainAll in interface java.util.List<E>
        Overrides:
        retainAll in class java.util.AbstractCollection<E>
      • ensureCapacity

        private void ensureCapacity​(int additional)
      • copyArray

        private void copyArray()
      • increaseSize

        private void increaseSize​(int newSize)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.AbstractCollection<E>