|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.emory.mathcs.util.collections.ints.AbstractIntCollection
edu.emory.mathcs.util.collections.ints.IntArrayList
Array-based list of int numbers.
Constructor Summary | |
IntArrayList()
Creates a IntArrayList with initial capacity of 10. |
|
IntArrayList(int initialCapacity)
Creates a IntArrayList with the specified initial capacity. |
|
IntArrayList(IntCollection c)
Creates a IntArrayList, copying to it all elements from the specified int collection, in the order as returned by that collection's iterator. |
Method Summary | |
boolean |
add(int e)
Attempts to add the specified number to this collection. |
boolean |
addAll(IntCollection c)
Attempts to add to this collection all the numbers contained in the specified collection. |
boolean |
addAll(int index,
IntCollection c)
|
void |
addAt(int index,
int e)
Adds the value at the specified index, and moves elements starting at index to the right. |
void |
clear()
Removes all the numbers from this collection. |
boolean |
contains(int e)
Returns true if this collection contains specified number; false otherwise. |
boolean |
equals(java.lang.Object o)
|
int |
getAt(int index)
Returns the value at the specified index. |
int |
hashCode()
|
int |
indexOf(int e)
Returns the smallest index at which the list contains the specified number. |
boolean |
isEmpty()
Returns true if this collection is empty; false otherwise. |
IntIterator |
iterator()
Returns the iterator over numbers contained in this collection. |
int |
lastIndexOf(int e)
Returns the largest index at which the list contains the specified number. |
IntListIterator |
listIterator()
|
IntListIterator |
listIterator(int index)
|
boolean |
remove(int e)
Attempts to remove the specified number from this collection. |
int |
removeAt(int index)
Removes the value at the specified index, and shifts elements starting at index+1 to the left. |
int |
setAt(int index,
int e)
Sets the value at the specified index. |
int |
size()
Returns the number of elements in this collection. |
int |
size64()
Returns the number of elements in this collection. |
IntList |
subList(int fromIndex,
int toIndex)
|
int[] |
toArray()
Returns the newly allocated array containing all numbers from this collection, in the order returned by its iterator. |
int[] |
toArray(int[] a)
Returns an array containing all of the numbers in this collection. |
Methods inherited from class edu.emory.mathcs.util.collections.ints.AbstractIntCollection |
containsAll, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface edu.emory.mathcs.util.collections.ints.IntList |
containsAll, removeAll, retainAll |
Constructor Detail |
public IntArrayList()
public IntArrayList(int initialCapacity)
public IntArrayList(IntCollection c)
Method Detail |
public int size()
IntCollection
size
in interface IntList
size
in class AbstractIntCollection
public boolean isEmpty()
IntCollection
isEmpty
in interface IntList
isEmpty
in class AbstractIntCollection
public boolean contains(int e)
IntCollection
contains
in interface IntList
contains
in class AbstractIntCollection
public IntIterator iterator()
IntCollection
iterator
in interface IntList
iterator
in class AbstractIntCollection
public int[] toArray()
IntCollection
toArray
in interface IntList
toArray
in class AbstractIntCollection
public int[] toArray(int[] a)
IntCollection
If this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.
Like the IntCollection.toArray()
method, this method acts as bridge between
array-based and collection-based APIs. Further, this method may,
under certain circumstances, be used to save allocation costs.
toArray
in interface IntList
toArray
in class AbstractIntCollection
public boolean add(int e)
IntCollection
add
in interface IntList
add
in class AbstractIntCollection
public boolean remove(int e)
IntCollection
remove
in interface IntList
remove
in class AbstractIntCollection
public boolean addAll(IntCollection c)
IntCollection
addAll
in interface IntList
addAll
in class AbstractIntCollection
public boolean addAll(int index, IntCollection c)
addAll
in interface IntList
public void clear()
IntCollection
clear
in interface IntList
clear
in class AbstractIntCollection
public boolean equals(java.lang.Object o)
equals
in interface IntList
public int hashCode()
hashCode
in interface IntList
public int getAt(int index)
IntList
getAt
in interface IntList
index
- the index to retrieve the value from.
public int setAt(int index, int e)
IntList
setAt
in interface IntList
index
- the index to set the value at.e
- the new value.
public void addAt(int index, int e)
IntList
addAt
in interface IntList
index
- the index to add the value at.e
- the new value.public int removeAt(int index)
IntList
removeAt
in interface IntList
index
- the index to remove the value from.
public int indexOf(int e)
IntList
indexOf
in interface IntList
e
- the number to look for
public int lastIndexOf(int e)
IntList
lastIndexOf
in interface IntList
e
- the number to look for
public IntListIterator listIterator()
listIterator
in interface IntList
public IntListIterator listIterator(int index)
listIterator
in interface IntList
public IntList subList(int fromIndex, int toIndex)
subList
in interface IntList
public int size64()
IntCollection
size64
in interface IntCollection
size64
in class AbstractIntCollection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |