Class LowMemoryArrayList<E>

  • Direct Known Subclasses:
    DictionaryFactory.Node

    class LowMemoryArrayList<E>
    extends java.lang.Object
    An ArrayList that need only a minimum of memory size. The list will be need on reading the dictionary with a very large count.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private E[] elementData
      The array buffer into which the elements of the ArrayList are stored.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, E element)
      Inserts the specified element at the specified position in this list.
      void add​(E o)
      Appends the specified element to the end of this list.
      E get​(int index)
      Returns the element at the specified position in this list.
      int size()
      Returns the number of elements in this list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • elementData

        private transient E[] elementData
        The array buffer into which the elements of the ArrayList are stored. The capacity of the ArrayList is the length of this array buffer.
    • Constructor Detail

      • LowMemoryArrayList

        LowMemoryArrayList()
    • Method Detail

      • size

        public int size()
        Returns the number of elements in this list.
        Returns:
        the number of elements in this list.
      • get

        public E get​(int index)
        Returns the element at the specified position in this list.
        Parameters:
        index - index of the element to return
        Returns:
        the element at the specified position in this list
        Throws:
        java.lang.IndexOutOfBoundsException - if the index is out of range
      • add

        public void add​(E o)
        Appends the specified element to the end of this list.
        Parameters:
        o - element to be appended to this list.
      • add

        public void add​(int index,
                        E element)
        Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
        Parameters:
        index - index at which the specified element is to be inserted
        element - element to be inserted
        Throws:
        java.lang.IndexOutOfBoundsException - if the index is out of range