Class ArrayList4<E>

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

    public class ArrayList4<E>
    extends AbstractList4<E>
    implements java.lang.Cloneable, java.io.Serializable, java.util.RandomAccess, Activatable
    Transparent activatable ArrayList implementation. Implements List interface using an array to store elements. Each ArrayList4 instance has a capacity, which indicates the size of the internal array.

    When instantiated as a result of a query, all the internal members are NOT activated at all. When internal members are required to perform an operation, the instance transparently activates all the members.
    See Also:
    ArrayList, Activatable, Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ArrayList4()
      Same behavior as java.util.ArrayList
      ArrayList4​(int initialCapacity)
      Same behaviour as java.util.ArrayList
      ArrayList4​(java.util.Collection<? extends E> c)
      Same behaviour as java.util.ArrayList
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void activate​(ActivationPurpose purpose)
      activate basic implementation.
      void add​(int index, E element)
      same as java.util.ArrayList but transparently activates the members as required.
      boolean addAll​(int index, java.util.Collection<? extends E> c)
      same as java.util.ArrayList but transparently activates the members as required.
      boolean addAll​(java.util.Collection<? extends E> c)
      same as java.util.ArrayList but transparently activates the members as required.
      void bind​(Activator activator)
      bind basic implementation.
      void clear()
      same as java.util.ArrayList but transparently activates the members as required.
      java.lang.Object clone()
      same as java.util.ArrayList but transparently activates the members as required.
      void ensureCapacity​(int minCapacity)
      same as java.util.ArrayList but transparently activates the members as required.
      E get​(int index)
      same as java.util.ArrayList but transparently activates the members as required.
      int indexOf​(java.lang.Object o)
      same as java.util.ArrayList but transparently activates the members as required.
      int lastIndexOf​(java.lang.Object o)
      same as java.util.ArrayList but transparently activates the members as required.
      E remove​(int index)
      same as java.util.ArrayList but transparently activates the members as required.
      protected void removeRange​(int fromIndex, int toIndex)  
      E set​(int index, E element)
      same as java.util.ArrayList but transparently activates the members as required.
      int size()
      same as java.util.ArrayList but transparently activates the members as required.
      java.lang.Object[] toArray()
      same as java.util.ArrayList but transparently activates the members as required.
      <T> T[] toArray​(T[] a)
      same as java.util.ArrayList but transparently activates the members as required.
      void trimToSize()
      same as java.util.ArrayList but transparently activates the members as required.
      • 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

        replaceAll, sort, spliterator
    • Constructor Detail

      • ArrayList4

        public ArrayList4()
        Same behavior as java.util.ArrayList
        See Also:
        ArrayList
      • ArrayList4

        public ArrayList4​(java.util.Collection<? extends E> c)
        Same behaviour as java.util.ArrayList
        See Also:
        ArrayList
      • ArrayList4

        public ArrayList4​(int initialCapacity)
        Same behaviour as java.util.ArrayList
        See Also:
        ArrayList
    • Method Detail

      • bind

        public void bind​(Activator activator)
        bind basic implementation.
        Specified by:
        bind in interface Activatable
        Parameters:
        activator - the Activator instance to bind
        See Also:
        Activatable
      • add

        public void add​(int index,
                        E element)
        same as java.util.ArrayList but transparently activates the members as required.
        Specified by:
        add in interface java.util.List<E>
        Overrides:
        add in class AbstractList4<E>
        See Also:
        ArrayList, Activatable
      • addAll

        public boolean addAll​(java.util.Collection<? extends E> c)
        same as java.util.ArrayList but transparently activates the members as required.
        Specified by:
        addAll in interface java.util.Collection<E>
        Specified by:
        addAll in interface java.util.List<E>
        Overrides:
        addAll in class AbstractList4<E>
        See Also:
        ArrayList, Activatable
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends E> c)
        same as java.util.ArrayList but transparently activates the members as required.
        Specified by:
        addAll in interface java.util.List<E>
        Overrides:
        addAll in class AbstractList4<E>
        See Also:
        ArrayList, Activatable
      • clear

        public void clear()
        same as java.util.ArrayList but transparently activates the members as required.
        Specified by:
        clear in interface java.util.Collection<E>
        Specified by:
        clear in interface java.util.List<E>
        Overrides:
        clear in class AbstractList4<E>
        See Also:
        ArrayList, Activatable
      • clone

        public java.lang.Object clone()
        same as java.util.ArrayList but transparently activates the members as required.
        Overrides:
        clone in class java.lang.Object
        See Also:
        ArrayList, Activatable
      • ensureCapacity

        public void ensureCapacity​(int minCapacity)
        same as java.util.ArrayList but transparently activates the members as required.
        See Also:
        ArrayList, Activatable
      • get

        public E get​(int index)
        same as java.util.ArrayList but transparently activates the members as required.
        Specified by:
        get in interface java.util.List<E>
        Specified by:
        get in class AbstractList4<E>
        See Also:
        ArrayList, Activatable
      • indexOf

        public int indexOf​(java.lang.Object o)
        same as java.util.ArrayList but transparently activates the members as required.
        Specified by:
        indexOf in interface java.util.List<E>
        Overrides:
        indexOf in class AbstractList4<E>
        See Also:
        ArrayList, Activatable
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object o)
        same as java.util.ArrayList but transparently activates the members as required.
        Specified by:
        lastIndexOf in interface java.util.List<E>
        Overrides:
        lastIndexOf in class AbstractList4<E>
        See Also:
        ArrayList, Activatable
      • remove

        public E remove​(int index)
        same as java.util.ArrayList but transparently activates the members as required.
        Specified by:
        remove in interface java.util.List<E>
        Overrides:
        remove in class AbstractList4<E>
        See Also:
        ArrayList, Activatable
      • removeRange

        protected void removeRange​(int fromIndex,
                                   int toIndex)
        Overrides:
        removeRange in class AbstractList4<E>
      • set

        public E set​(int index,
                     E element)
        same as java.util.ArrayList but transparently activates the members as required.
        Specified by:
        set in interface java.util.List<E>
        Overrides:
        set in class AbstractList4<E>
        See Also:
        ArrayList, Activatable
      • size

        public int size()
        same as java.util.ArrayList but transparently activates the members as required.
        Specified by:
        size in interface java.util.Collection<E>
        Specified by:
        size in interface java.util.List<E>
        Specified by:
        size in class AbstractList4<E>
        See Also:
        ArrayList, Activatable
      • toArray

        public java.lang.Object[] toArray()
        same as java.util.ArrayList but transparently activates the members as required.
        Specified by:
        toArray in interface java.util.Collection<E>
        Specified by:
        toArray in interface java.util.List<E>
        Overrides:
        toArray in class AbstractList4<E>
        See Also:
        ArrayList, Activatable
      • toArray

        public <T> T[] toArray​(T[] a)
        same as java.util.ArrayList but transparently activates the members as required.
        Specified by:
        toArray in interface java.util.Collection<E>
        Specified by:
        toArray in interface java.util.List<E>
        Overrides:
        toArray in class AbstractList4<E>
        See Also:
        ArrayList, Activatable
      • trimToSize

        public void trimToSize()
        same as java.util.ArrayList but transparently activates the members as required.
        See Also:
        ArrayList, Activatable