Reusable Java library of general tools with minimal external dependencies.
For questions or support, please contact us:
Email: support@aoindustries.com
Phone: 1-800-519-9541
Phone: +1-251-607-9556
Web: https://www.aoindustries.com/contact
public class SortedIntArrayList extends IntArrayList implements Cloneable, Serializable
SortedIntArrayList stores is elements in numerical order and provides means of quickly
locating objects.elementData, sizemodCount| Constructor and Description |
|---|
SortedIntArrayList()
Constructs an empty list with an initial capacity of ten.
|
SortedIntArrayList(int initialCapacity)
Constructs an empty list with the specified initial capacity.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(int o)
Adds the specified element in sorted position within this list.
|
void |
add(int index,
int element)
Not allowed to add to specific indexes.
|
boolean |
addAll(Collection<? extends Integer> c)
Adds all of the elements in the specified Collection and sorts during
the add.
|
boolean |
addAll(int index,
Collection<? extends Integer> c)
Not allowed to add to a specific index.
|
protected int |
binarySearch(int value)
Performs a binary search for the provide value.
|
int |
indexOf(int elem)
Searches for the first occurrence of the given value.
|
int |
lastIndexOf(int elem)
Returns the index of the last occurrence of the specified object in
this list.
|
boolean |
removeByValue(int value)
Removes a single instance of the specified element from this
list, if it is present (optional operation).
|
int |
set(int index,
int element)
Not allowed to set specific indexes.
|
add, add, clear, clone, contains, contains, ensureCapacity, get, getInt, indexOf, isEmpty, lastIndexOf, remove, remove, removeAtIndex, removeRange, set, size, toArray, toArray, toArrayInt, trimToSizeequals, hashCode, iterator, listIterator, listIterator, subListcontainsAll, removeAll, retainAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, replaceAll, retainAll, sort, spliterator, subListparallelStream, removeIf, streampublic SortedIntArrayList(int initialCapacity)
initialCapacity - the initial capacity of the list.IllegalArgumentException - if the specified initial capacity
is negativepublic SortedIntArrayList()
protected int binarySearch(int value)
public int indexOf(int elem)
indexOf in interface IntListindexOf in class IntArrayListelem - the valueObject.equals(Object)public int lastIndexOf(int elem)
lastIndexOf in interface IntListlastIndexOf in class IntArrayListelem - the desired element.public int set(int index,
int element)
set in interface IntListset in class IntArrayListindex - index of element to replace.element - element to be stored at the specified position.public boolean add(int o)
add in interface IntCollectionadd in class IntArrayListo - element to be appended to this list.public void add(int index,
int element)
add in interface IntListadd in class IntArrayListindex - index at which the specified element is to be inserted.element - element to be inserted.public boolean removeByValue(int value)
removeByValue in interface IntCollectionremoveByValue in class IntArrayListvalue - element to be removed from this list, if present.public boolean addAll(Collection<? extends Integer> c)
addAll in interface Collection<Integer>addAll in interface List<Integer>addAll in class IntArrayListc - the elements to be inserted into this list.public boolean addAll(int index,
Collection<? extends Integer> c)
addAll in interface List<Integer>addAll in class IntArrayListindex - index at which to insert first element
from the specified collection.c - elements to be inserted into this list.Copyright © 2000–2016 AO Industries, Inc.. All rights reserved.