IntList on top of a primitive array.
| Modifier and Type | Field and Description |
|---|---|
| private int[] | array
The backing store for the list. |
| private static final IntArrayList | |
| private int | size
The size of the list distinct from the length of the array. |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| private | IntArrayList(int[] other, int size)
Constructs a new mutable |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(int
index at which the specified element is to be inserted index, Integer element to be inserted element)Overrides com. Implements java. |
| public boolean | addAll(Collection<? extends Integer>
collection containing elements to be added to this list collection)Overrides com. Implements java. |
| public void | addInt(int element)
Implements com. add(Integer) but more efficient in that it doesn't box the element.
|
| private void | addInt(int index, int element)
Like |
| public static IntArrayList | |
| private void | ensureIndexInRange(int
the index to verify is in range index)Ensures that the provided |
| public boolean | equals(Object
the object to be compared for equality with this list o)Overrides com. Implements java. |
| public Integer | get(int
index of the element to return index)Implements abstract java. Implements java. |
| public int | getInt(int index)
Implements com. get(int) but more efficient in that it doesn't box the returned value.
|
| public int | hashCode()
Overrides com. Implements java. |
| private String | |
| public Internal. | mutableCopyWithCapacity(int capacity)
Implements com. |
| public boolean | remove(Object
element to be removed from this list, if present o)Overrides com. Implements java. |
| public Integer | remove(int
the index of the element to be removed index)Overrides com. Implements java. |
| protected void | removeRange(int
index of first element to be removed fromIndex, int index after last element to be removed toIndex)Overrides java. fromIndex, inclusive, and toIndex, exclusive.
|
| public Integer | set(int
index of the element to replace index, Integer element to be stored at the specified position element)Overrides com. Implements java. |
| public int | setInt(int index, int element)
Implements com. set(int, Object) but more efficient in that it doesn't box the element.
|
| public int | size()
Implements abstract java. Implements java. |
| array | back to summary |
|---|---|
| private int[] array The backing store for the list. | |
| EMPTY_LIST | back to summary |
|---|---|
| private static final IntArrayList EMPTY_LIST | |
| size | back to summary |
|---|---|
| private int size The size of the list distinct from the length of the array. That is, it is the number of elements set in the list. | |
| IntArrayList | back to summary |
|---|---|
| pack-priv IntArrayList() Constructs a new mutable | |
| IntArrayList | back to summary |
|---|---|
| private IntArrayList(int[] other, int size) Constructs a new mutable | |
| add | back to summary |
|---|---|
| public void add(int index, Integer element) Overrides com. Implements java. Doc from java. Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). | |
| addAll | back to summary |
|---|---|
| public boolean addAll(Collection<? extends Integer> collection) Overrides com. Implements java. Doc from java. 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 (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
| |
| addInt | back to summary |
|---|---|
| public void addInt(int element) Implements com. Like
| |
| addInt | back to summary |
|---|---|
| private void addInt(int index, int element) Like | |
| emptyList | back to summary |
|---|---|
| public static IntArrayList emptyList() | |
| ensureIndexInRange | back to summary |
|---|---|
| private void ensureIndexInRange(int index) Ensures that the provided
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides com. Implements java. Doc from java. Compares the specified object with this list for equality. Returns
| |
| get | back to summary |
|---|---|
| public Integer get(int index) Implements abstract java. Implements java. Doc from java. Returns the element at the specified position in this list. | |
| getInt | back to summary |
|---|---|
| public int getInt(int index) Implements com. Doc from com. Like
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides com. Implements java. Doc from java. Returns the hash code value for this list. The hash code of a list is defined to be the result of the following calculation:
This ensures that list1.equals(list2) implies that
list1.hashCode()==list2.hashCode() for any two lists,
list1 and list2, as required by the general
contract of Object#hashCode.
| |
| makeOutOfBoundsExceptionMessage | back to summary |
|---|---|
| private String makeOutOfBoundsExceptionMessage(int index) | |
| mutableCopyWithCapacity | back to summary |
|---|---|
| public Internal. Implements com. Doc from com. Returns a mutable clone of this list with the specified capacity.
| |
| remove | back to summary |
|---|---|
| public boolean remove(Object o) Overrides com. Implements java. Doc from java. Removes the first occurrence of the specified element from this list,
if it is present (optional operation). If this list does not contain
the element, it is unchanged. More formally, removes the element with
the lowest index | |
| remove | back to summary |
|---|---|
| public Integer remove(int index) Overrides com. Implements java. Doc from java. Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list. | |
| removeRange | back to summary |
|---|---|
| protected void removeRange(int fromIndex, int toIndex) Overrides java. Doc from java. Removes from this list all of the elements whose index is between
This method is called by the
| |
| set | back to summary |
|---|---|
| public Integer set(int index, Integer element) Overrides com. Implements java. Doc from java. Replaces the element at the specified position in this list with the specified element (optional operation). | |
| setInt | back to summary |
|---|---|
| public int setInt(int index, int element) Implements com. Doc from com. Like
| |
| size | back to summary |
|---|---|
| public int size() Implements abstract java. Implements java. Doc from java. Returns the number of elements in this list. If this list contains
more than
| |