java.util.List , IntList does not require each int to be boxed. This makes it helpful in use cases
where storing Integer leads to excessive time spent in garbage collection.
| Modifier and Type | Field and Description |
|---|---|
| private int[] | |
| public static final int | |
| private static final int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | IntList(final int
The number of ints that can be stored in this IntList before it will need to be
reallocated. initialCapacity)Constructs a new IntList with the specified capacity. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(int
The int to add to the end of the list. value)Appends an int to the end of the list, growing the list if necessary. |
| public void | |
| public int | Returns: The int at indexindex in the list.The list index of the desired int. index)Returns the |
| private void | |
| public boolean | |
| public int | |
| public String |
| data | back to summary |
|---|---|
| private int[] data | |
| DEFAULT_INITIAL_CAPACITY | back to summary |
|---|---|
| public static final int DEFAULT_INITIAL_CAPACITY | |
| GROWTH_MULTIPLIER | back to summary |
|---|---|
| private static final int GROWTH_MULTIPLIER | |
| numberOfValues | back to summary |
|---|---|
| private int numberOfValues | |
| IntList | back to summary |
|---|---|
| public IntList() Constructs a new IntList with a capacity of | |
| IntList | back to summary |
|---|---|
| public IntList(final int initialCapacity) Constructs a new IntList with the specified capacity.
| |
| IntList | back to summary |
|---|---|
| public IntList(final IntList other) Constructs a new IntList that contains all the elements of the given IntList.
| |
| add | back to summary |
|---|---|
| public void add(int value) Appends an int to the end of the list, growing the list if necessary.
| |
| clear | back to summary |
|---|---|
| public void clear() Empties the list. Note that this method does not shrink the size of the backing data store. | |
| get | back to summary |
|---|---|
| public int get(int index) Returns the
| |
| grow | back to summary |
|---|---|
| private void grow() Reallocates the backing array to accommodate storing more ints. | |
| isEmpty | back to summary |
|---|---|
public boolean isEmpty()
| |
| size | back to summary |
|---|---|
| public int size() Accessor.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |