Todo
unused?
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| protected int[] | |
| protected int |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(int
element to be appended to this list o)Overrides java. Implements java. |
| public int | |
| public Object | |
| public boolean | |
| public int | |
| public int[] | |
| public void | |
| public boolean | equals(Object
the object to be compared for equality with this list o)Overrides java. Implements java. |
| public Integer | get(int
index of the element to return i)Implements abstract java. Implements java. |
| protected void | |
| public int | set(int
index of the element to replace i, int element to be stored at the specified position newValue)Overrides java. Implements java. |
| public void | |
| public int | size()
Implements abstract java. Implements java. |
| public String | toString()
Overrides java. |
| DEFAULT_CAPACITY | back to summary |
|---|---|
| private static final int DEFAULT_CAPACITY | |
| elements | back to summary |
|---|---|
| protected int[] elements | |
| n | back to summary |
|---|---|
| protected int n | |
| IntArrayList | back to summary |
|---|---|
| public IntArrayList() | |
| IntArrayList | back to summary |
|---|---|
| public IntArrayList(int initialCapacity) | |
| add | back to summary |
|---|---|
| public boolean add(int o) Overrides java. Implements java. Doc from java. Appends the specified element to the end of this list (optional operation). Lists that support this operation may place limitations on what elements may be added to this list. In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. List classes should clearly specify in their documentation any restrictions on what elements may be added.
| |
| capacity | back to summary |
|---|---|
| public int capacity() | |
| clone | back to summary |
|---|---|
| public Object clone() throws CloneNotSupportedException Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| contains | back to summary |
|---|---|
| public boolean contains(int v) | |
| element | back to summary |
|---|---|
| public int element(int i) | |
| elements | back to summary |
|---|---|
| public int[] elements() | |
| ensureCapacity | back to summary |
|---|---|
| public void ensureCapacity(int newCapacity) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Implements java. Doc from java. Compares the specified object with this list for equality. Returns
| |
| get | back to summary |
|---|---|
| public Integer get(int i) Implements abstract java. Implements java. Doc from java. Returns the element at the specified position in this list.
| |
| grow | back to summary |
|---|---|
| protected void grow() | |
| set | back to summary |
|---|---|
| public int set(int i, int newValue) Overrides java. Implements java. Set the ith element. Like ArrayList, this does NOT affect size.
| |
| setSize | back to summary |
|---|---|
| public void setSize(int newSize) | |
| 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
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of this collection. The string
representation consists of a list of the collection's elements in the
order they are returned by its iterator, enclosed in square brackets
( | |