public class IntegerList extends Object
Constructor and Description |
---|
IntegerList() |
IntegerList(Collection<Integer> list) |
IntegerList(int capacity) |
IntegerList(IntegerList list) |
Modifier and Type | Method and Description |
---|---|
void |
add(int value) |
void |
addAll(Collection<Integer> list) |
void |
addAll(int[] array) |
void |
addAll(IntegerList list) |
int |
binarySearch(int key) |
int |
binarySearch(int fromIndex,
int toIndex,
int key) |
void |
clear() |
boolean |
contains(int value) |
boolean |
equals(Object o)
Compares the specified object with this list for equality.
|
int |
get(int index) |
int |
hashCode()
Returns the hash code value for this list.
|
boolean |
isEmpty() |
int |
removeAt(int index) |
void |
removeRange(int fromIndex,
int toIndex) |
int |
set(int index,
int value) |
int |
size() |
void |
sort() |
int[] |
toArray() |
String |
toString()
Returns a string representation of this list.
|
void |
trimToSize() |
public IntegerList()
public IntegerList(int capacity)
public IntegerList(IntegerList list)
public IntegerList(Collection<Integer> list)
public final void add(int value)
public final void addAll(int[] array)
public final void addAll(IntegerList list)
public final void addAll(Collection<Integer> list)
public final int get(int index)
public final boolean contains(int value)
public final int set(int index, int value)
public final int removeAt(int index)
public final void removeRange(int fromIndex, int toIndex)
public final boolean isEmpty()
public final int size()
public final void trimToSize()
public final void clear()
public final int[] toArray()
public final void sort()
public boolean equals(Object o)
true
if and only if the specified object is also an IntegerList
,
both lists have the same size, and all corresponding pairs of elements in
the two lists are equal. In other words, two lists are defined to be
equal if they contain the same elements in the same order.
This implementation first checks if the specified object is this
list. If so, it returns true
; if not, it checks if the
specified object is an IntegerList
. If not, it returns false
;
if so, it checks the size of both lists. If the lists are not the same size,
it returns false
; otherwise it iterates over both lists, comparing
corresponding pairs of elements. If any comparison returns false
,
this method returns false
.
public int hashCode()
This implementation uses exactly the code that is used to define the
list hash function in the documentation for the List.hashCode()
method.
public String toString()
public final int binarySearch(int key)
public final int binarySearch(int fromIndex, int toIndex, int key)
Copyright © 1992-2015 ANTLR. All Rights Reserved.