public class TLcdIntArrayList extends AbstractList<Integer> implements Cloneable, ILcdIntList
ILcdIntList
.modCount
Constructor and Description |
---|
TLcdIntArrayList()
Creates a new, empty
TLcdIntArrayList . |
TLcdIntArrayList(int aInitialCapacity)
Creates a new, empty
TLcdIntArrayList with the specified initial capacity. |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
Integer element) |
boolean |
addAll(Collection<? extends Integer> c) |
boolean |
addAll(int index,
Collection<? extends Integer> c) |
boolean |
addAll(int aIndex,
int[] aValues,
int aOffset,
int aLength)
Adds
aLength integer values from the given array to this list, starting from the given aOffset |
boolean |
addInt(int aValue)
Appends the specified value to the end of this list (optional operation).
|
void |
addInt(int aIndex,
int aValue)
Inserts the specified value at the specified position in this list (optional operation).
|
int |
binarySearch(int aKey)
Performs a binary search on this list.
|
void |
clear() |
TLcdIntArrayList |
clone()
Creates and returns a copy of this object.
|
boolean |
contains(Object aO) |
boolean |
containsInt(int aValue)
Returns
true if this list contains the specified value. |
void |
ensureCapacity(int minCapacity)
Increases the capacity of this list to the specified capacity.
|
boolean |
equals(Object o) |
Integer |
get(int index) |
int |
getInt(int aIndex)
Returns the value at the specified position in this list.
|
int |
hashCode() |
int |
indexOf(Object aO) |
int |
indexOfInt(int aValue)
Returns the index of the first occurrence of the specified value in this list, or -1 if this list does not
contain the value.
|
int |
lastIndexOf(Object aO) |
int |
lastIndexOfInt(int aValue)
Returns the index of the last occurrence of the specified value in this list, or -1 if this list does not
contain the value.
|
Integer |
remove(int index) |
int |
removeInt(int aIndex)
Removes the value at the specified position in this list (optional operation).
|
boolean |
removeIntValue(int aValue)
Removes the first occurrence of the specified value from this list, if it is present (optional operation).
|
Integer |
set(int index,
Integer element) |
int |
setInt(int aIndex,
int aValue)
Replaces the value at the specified position in this list with the specified value (optional operation).
|
int |
size() |
int[] |
toIntArray()
Returns an array containing all of the values in this list in proper sequence (from first to last value).
|
int[] |
toIntArray(int[] anArray)
Returns an array containing all of the values in this list in proper sequence (from first to last value);
If the list fits in the specified array, t is returned therein.
|
String |
toString() |
void |
trimToSize()
Trims the internal data array of this list to match the size of this list.
|
add, iterator, listIterator, listIterator, removeRange, subList
containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, addAll, addAll
add, containsAll, isEmpty, iterator, listIterator, listIterator, remove, removeAll, replaceAll, retainAll, sort, spliterator, subList, toArray, toArray
parallelStream, removeIf, stream
public TLcdIntArrayList()
TLcdIntArrayList
.public TLcdIntArrayList(int aInitialCapacity)
TLcdIntArrayList
with the specified initial capacity.aInitialCapacity
- the initial capacity of this list.public int size()
size
in interface Collection<Integer>
size
in interface List<Integer>
size
in class AbstractCollection<Integer>
public Integer get(int index)
public void add(int index, Integer element)
public boolean addAll(Collection<? extends Integer> c)
addAll
in interface Collection<Integer>
addAll
in interface List<Integer>
addAll
in class AbstractCollection<Integer>
public boolean addAll(int index, Collection<? extends Integer> c)
public boolean addAll(int aIndex, int[] aValues, int aOffset, int aLength)
ILcdIntList
aLength
integer values from the given array to this list, starting from the given aOffset
addAll
in interface ILcdIntList
aIndex
- The position in this list where to start inserting the given integer values.aValues
- The array containing the integer values to add to this listaOffset
- The offset in aValues
from where to start copying the integer valuesaLength
- The number of integer values to copy from aValues
to this list.public Integer remove(int index)
public int getInt(int aIndex)
ILcdIntList
getInt
in interface ILcdIntList
aIndex
- index of the value to returnpublic int setInt(int aIndex, int aValue)
ILcdIntList
setInt
in interface ILcdIntList
aIndex
- index of the value to replaceaValue
- value to be stored at the specified positionpublic boolean addInt(int aValue)
ILcdIntList
addInt
in interface ILcdIntList
aValue
- value to be appended to this listtrue
public void addInt(int aIndex, int aValue)
ILcdIntList
addInt
in interface ILcdIntList
aIndex
- index at which the specified value is to be insertedaValue
- value to be insertedpublic boolean removeIntValue(int aValue)
ILcdIntList
true
if this list contained the specified value (or equivalently, if this list changed as a
result of the call).removeIntValue
in interface ILcdIntList
aValue
- value to be removed from this list, if presenttrue
if this list contained the specified valuepublic int removeInt(int aIndex)
ILcdIntList
removeInt
in interface ILcdIntList
aIndex
- the index of the value to be removedpublic int[] toIntArray()
ILcdIntList
toIntArray
in interface ILcdIntList
public int[] toIntArray(int[] anArray)
ILcdIntList
toIntArray
in interface ILcdIntList
anArray
- the array into which the values of this list are to be stored, if it is big enough; otherwise,
a new array is allocated for this purpose.public void clear()
clear
in interface Collection<Integer>
clear
in interface List<Integer>
clear
in class AbstractList<Integer>
public int binarySearch(int aKey)
Collections.binarySearch(List, Object)
.
The list must be sorted into ascending order
according to the natural ordering of its
elements (as by the Collections.sort(List)
method) prior to making this
call. If it is not sorted, the results are undefined. If the list
contains multiple elements equal to the specified object, there is no
guarantee which one will be found.aKey
- the value to searchCollections.binarySearch(List, Object)
public TLcdIntArrayList clone()
ILcdIntList
clone
in interface ILcdIntList
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()
public void ensureCapacity(int minCapacity)
minCapacity
- the new capacity for this list.public void trimToSize()
public int indexOf(Object aO)
public int indexOfInt(int aValue)
ILcdIntList
indexOfInt
in interface ILcdIntList
aValue
- value to search forpublic int lastIndexOf(Object aO)
lastIndexOf
in interface List<Integer>
lastIndexOf
in class AbstractList<Integer>
public int lastIndexOfInt(int aValue)
ILcdIntList
lastIndexOfInt
in interface ILcdIntList
aValue
- value to search forpublic boolean containsInt(int aValue)
ILcdIntList
true
if this list contains the specified value.containsInt
in interface ILcdIntList
aValue
- value whose presence in this list is to be testedtrue
if this list contains the specified valuepublic boolean contains(Object aO)
contains
in interface Collection<Integer>
contains
in interface List<Integer>
contains
in class AbstractCollection<Integer>
public boolean equals(Object o)
equals
in interface Collection<Integer>
equals
in interface List<Integer>
equals
in class AbstractList<Integer>
public int hashCode()
hashCode
in interface Collection<Integer>
hashCode
in interface List<Integer>
hashCode
in class AbstractList<Integer>
public String toString()
toString
in class AbstractCollection<Integer>