E
- The type of elements in this list.public class IdentityArrayList<E> extends ArrayList<E>
ArrayList
that resorts to the ==
operator when checking an
element for equality, instead of the Object.equals(Object)
method.
This class overrides all methods that perform a test for equality of elements
in the list, and supports the sub-list operation by returning an
IdentityArrayList.IdentitySubList
.
ArrayList
,
Serialized FormModifier and Type | Class and Description |
---|---|
protected class |
IdentityArrayList.IdentitySubList
A
DelegateList providing the same behavior of
IdentityArrayList to the class returned by
ArrayList.subList(int,int) . |
modCount
Constructor and Description |
---|
IdentityArrayList()
Constructs an empty list with an initial capacity of ten.
|
IdentityArrayList(Collection<? extends E> c)
Constructs a list containing the elements of the specified collection, in
the order they are returned by the collection's iterator.
|
IdentityArrayList(int initialCapacity)
Constructs an empty list with the specified initial capacity.
|
Modifier and Type | Method and Description |
---|---|
IdentityArrayList<E> |
clone() |
boolean |
contains(Object o) |
int |
indexOf(Object o) |
int |
lastIndexOf(Object o) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
List<E> |
subList(int fromIndex,
int toIndex) |
add, add, addAll, addAll, clear, ensureCapacity, forEach, get, isEmpty, iterator, listIterator, listIterator, remove, removeIf, removeRange, replaceAll, set, size, sort, spliterator, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
parallelStream, stream
public IdentityArrayList(int initialCapacity)
initialCapacity
- The initial capacity of the list.IllegalArgumentException
- If the specified initial capacity is
negative.public IdentityArrayList(Collection<? extends E> c)
c
- The collection whose elements are to be placed into this list.NullPointerException
- If the specified collection is null.public IdentityArrayList()
public boolean contains(Object o)
public int indexOf(Object o)
public int lastIndexOf(Object o)
lastIndexOf
in interface List<E>
lastIndexOf
in class ArrayList<E>
public boolean remove(Object o)
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public IdentityArrayList<E> clone()
Copyright © 2020 LibJ. All rights reserved.