Documentation of 'org.hsqldb.lib.HsqlArrayList' Java class
HsqlArrayList
org.hsqldb.lib

Class HsqlArrayList

  • All Implemented Interfaces:
    Collection, HsqlList
    Direct Known Subclasses:
    ArrayListIdentity


    public class HsqlArrayList
    extends java.lang.Object
    implements HsqlList
    Intended as an asynchronous alternative to Vector. Use HsqlLinkedList instead if it's better suited.
    Since:
    1.7.0
    • Constructor Summary

      Constructors 
      Constructor and Description
      HsqlArrayList()
      Creates a new instance of HsqlArrayList
      HsqlArrayList(int initialCapacity)
      Creates a new instance with the given initial capacity
      HsqlArrayList(int initialCapacity, boolean minimize)
      Creates a new instance of HsqlArrayList that minimizes the size when empty
      HsqlArrayList(java.lang.Object[] data, int count) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(int index, java.lang.Object element)
      Inserts an element at the given index
      boolean add(java.lang.Object element)
      Appends an element to the end of the list
      boolean addAll(Collection other) 
      boolean addAll(java.lang.Object[] array) 
      void clear() 
      boolean contains(java.lang.Object o) 
      java.lang.Object get(int index)
      Gets the element at given position
      java.lang.Object[] getArray() 
      int indexOf(java.lang.Object o)
      returns the index of given object or -1 if not found
      boolean isEmpty() 
      Iterator iterator() 
      java.lang.Object remove(int index)
      Removes and returns the element at given position
      boolean remove(java.lang.Object o) 
      java.lang.Object set(int index, java.lang.Object element)
      Replaces the element at given position
      void setSize(int newSize)
      Increase or reduce the size, setting discarded or added elements to null.
      int size()
      Returns the number of elements in the array list
      void sort(java.util.Comparator c) 
      java.lang.Object[] toArray() 
      java.lang.Object[] toArray(int start, int limit) 
      java.lang.Object toArray(java.lang.Object a)
      Copies all elements of the list to a[].
      java.lang.String toString()
      Returns a string representation
      void trim()
      Trims the array to be the same size as the number of elements.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • HsqlArrayList

        public HsqlArrayList(java.lang.Object[] data,
                             int count)
      • HsqlArrayList

        public HsqlArrayList()
        Creates a new instance of HsqlArrayList
      • HsqlArrayList

        public HsqlArrayList(int initialCapacity,
                             boolean minimize)
        Creates a new instance of HsqlArrayList that minimizes the size when empty
      • HsqlArrayList

        public HsqlArrayList(int initialCapacity)
        Creates a new instance with the given initial capacity
    • Method Detail

      • add

        public void add(int index,
                        java.lang.Object element)
        Inserts an element at the given index
        Specified by:
        add in interface HsqlList
      • add

        public boolean add(java.lang.Object element)
        Appends an element to the end of the list
        Specified by:
        add in interface Collection
        Specified by:
        add in interface HsqlList
      • get

        public java.lang.Object get(int index)
        Gets the element at given position
        Specified by:
        get in interface HsqlList
      • indexOf

        public int indexOf(java.lang.Object o)
        returns the index of given object or -1 if not found
      • remove

        public java.lang.Object remove(int index)
        Removes and returns the element at given position
        Specified by:
        remove in interface HsqlList
      • set

        public java.lang.Object set(int index,
                                    java.lang.Object element)
        Replaces the element at given position
        Specified by:
        set in interface HsqlList
      • size

        public final int size()
        Returns the number of elements in the array list
        Specified by:
        size in interface Collection
        Specified by:
        size in interface HsqlList
      • trim

        public void trim()
        Trims the array to be the same size as the number of elements.
      • clear

        public void clear()
        Specified by:
        clear in interface Collection
      • setSize

        public void setSize(int newSize)
        Increase or reduce the size, setting discarded or added elements to null.
      • toArray

        public java.lang.Object[] toArray()
      • toArray

        public java.lang.Object[] toArray(int start,
                                          int limit)
      • toArray

        public java.lang.Object toArray(java.lang.Object a)
        Copies all elements of the list to a[]. It is assumed a[] is of the correct type. If a[] is too small, a new array or the same type is returned. If a[] is larger, only the list elements are copied and no other change is made to the array. Differs from the implementation in java.util.ArrayList in the second aspect.
      • sort

        public void sort(java.util.Comparator c)
      • getArray

        public java.lang.Object[] getArray()
      • contains

        public boolean contains(java.lang.Object o)
      • remove

        public boolean remove(java.lang.Object o)
      • addAll

        public boolean addAll(Collection other)
      • addAll

        public boolean addAll(java.lang.Object[] array)
      • isEmpty

        public boolean isEmpty()
      • toString

        public java.lang.String toString()
        Returns a string representation
        Overrides:
        toString in class java.lang.Object

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.