Type Parameters:
E - the type of elements in this list
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess, SequencedCollection<E>
Direct Known Subclasses:
AttributeList, RoleList, RoleUnresolvedList

  • Field Summary

    Fields declared in class AbstractList

    modCount

    protected int

    The number of times this list has been structurally modified.

  • Constructor Summary

    Constructors

    ArrayList()

    Constructs an empty list with an initial capacity of ten.

    ArrayList(int initialCapacity)

    Constructs an empty list with the specified initial capacity.

    Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.

  • Method Summary

    void

    add(int index, E element)

    Inserts the specified element at the specified position in this list.

    boolean

    add(E e)

    Appends the specified element to the end of this list.

    boolean

    Inserts all of the elements in the specified collection into this list, starting at the specified position.

    boolean

    Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's Iterator.

    void

    addFirst(E element)

    Adds an element as the first element of this collection (optional operation).

    void

    addLast(E element)

    Adds an element as the last element of this collection (optional operation).

    void

    clear()

    Removes all of the elements from this list.

    clone()

    Returns a shallow copy of this ArrayList instance.

    boolean

    Returns true if this list contains the specified element.

    void

    ensureCapacity(int minCapacity)

    Increases the capacity of this ArrayList instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument.

    void

    Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.

    get(int index)

    Returns the element at the specified position in this list.

    getFirst()

    Gets the first element of this collection.

    getLast()

    Gets the last element of this collection.

    int

    Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.

    boolean

    isEmpty()

    Returns true if this list contains no elements.

    iterator()

    Returns an iterator over the elements in this list in proper sequence.

    int

    Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.

    Returns a list iterator over the elements in this list (in proper sequence).

    listIterator(int index)

    Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.

    remove(int index)

    Removes the element at the specified position in this list.

    boolean

    Removes the first occurrence of the specified element from this list, if it is present.

    boolean

    Removes from this list all of its elements that are contained in the specified collection.

    Removes and returns the first element of this collection (optional operation).

    boolean

    Removes all of the elements of this collection that satisfy the given predicate (optional operation).

    Removes and returns the last element of this collection (optional operation).

    protected void

    removeRange(int fromIndex, int toIndex)

    Removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive.

    boolean

    Retains only the elements in this list that are contained in the specified collection.

    set(int index, E element)

    Replaces the element at the specified position in this list with the specified element.

    int

    size()

    Returns the number of elements in this list.

    subList(int fromIndex, int toIndex)

    Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.

    toArray()

    Returns an array containing all of the elements in this list in proper sequence (from first to last element).

    <T> T[]

    toArray(T[] a)

    Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array.

    void

    Trims the capacity of this ArrayList instance to be the list's current size.

    Methods declared in class AbstractList

    equals, hashCode

    boolean

    Compares the specified object with this list for equality.

    int

    Returns the hash code value for this list.

    Methods declared in class AbstractCollection

    containsAll, toString

    boolean

    Returns true if this collection contains all of the elements in the specified collection.

    Returns a string representation of this collection.

    Methods declared in class Object

    finalize, getClass, notify, notifyAll, wait, wait, wait

    protected void

    Deprecated, for removal: This API element is subject to removal in a future version.

    Returns the runtime class of this Object.

    final void

    Wakes up a single thread that is waiting on this object's monitor.

    final void

    Wakes up all threads that are waiting on this object's monitor.

    final void

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

    final void

    wait(long timeoutMillis)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

    final void

    wait(long timeoutMillis, int nanos)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

    Methods declared in interface Collection

    parallelStream, stream, toArray

    Returns a possibly parallel Stream with this collection as its source.

    Returns a sequential Stream with this collection as its source.

    default <T> T[]

    Returns an array containing all of the elements in this collection, using the provided generator function to allocate the returned array.

    Methods declared in interface List

    containsAll, replaceAll, reversed, sort

    boolean

    Returns true if this list contains all of the elements of the specified collection.

    default void

    Replaces each element of this list with the result of applying the operator to that element (optional operation).

    Returns a reverse-ordered view of this collection.

    default void

    Sorts this list according to the order induced by the specified Comparator (optional operation).

  • Constructor Details

    • ArrayList

    • ArrayList

    • ArrayList

  • Method Details

    • trimToSize

    • ensureCapacity

    • size

    • isEmpty

    • contains

    • indexOf

    • lastIndexOf

    • clone

    • toArray

    • toArray

    • get

    • getFirst

    • getLast

    • set

    • add

    • add

    • addFirst

    • addLast

    • remove

    • removeFirst

    • removeLast

    • remove

    • clear

    • addAll

    • addAll

    • removeRange

    • removeAll

    • retainAll

    • listIterator

    • listIterator

    • iterator

    • subList

    • forEach

    • spliterator

    • removeIf