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 SortedLongArrayList extends LongArrayList implements Cloneable, Serializable
SortedLongArrayList stores is elements in numerical order and provides means of quickly
locating objects.elementData, sizemodCount| Constructor and Description |
|---|
SortedLongArrayList()
Constructs an empty list with an initial capacity of ten.
|
SortedLongArrayList(int initialCapacity)
Constructs an empty list with the specified initial capacity.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
long element)
Not allowed to add to specific indexes.
|
boolean |
add(long o)
Adds the specified element in sorted position within this list.
|
boolean |
addAll(Collection<? extends Long> c)
Adds all of the elements in the specified Collection and sorts during
the add.
|
boolean |
addAll(int index,
Collection<? extends Long> c)
Not allowed to add to a specific index.
|
protected int |
binarySearch(long value)
Performs a binary search for the provide value.
|
int |
indexOf(long elem)
Searches for the first occurrence of the given value.
|
int |
lastIndexOf(long elem)
Returns the index of the last occurrence of the specified object in
this list.
|
boolean |
removeByValue(long value)
Removes a single instance of the specified element from this
list, if it is present (optional operation).
|
long |
set(int index,
long element)
Not allowed to set specific indexes.
|
add, add, clear, clone, contains, contains, ensureCapacity, get, getLong, indexOf, isEmpty, lastIndexOf, remove, remove, removeAtIndex, removeRange, set, size, toArray, toArray, toArrayLong, 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 SortedLongArrayList(int initialCapacity)
initialCapacity - the initial capacity of the list.IllegalArgumentException - if the specified initial capacity
is negativepublic SortedLongArrayList()
protected int binarySearch(long value)
public int indexOf(long elem)
indexOf in interface LongListindexOf in class LongArrayListelem - the valueObject.equals(Object)public int lastIndexOf(long elem)
lastIndexOf in interface LongListlastIndexOf in class LongArrayListelem - the desired element.public long set(int index,
long element)
set in interface LongListset in class LongArrayListindex - index of element to replace.element - element to be stored at the specified position.public boolean add(long o)
add in interface LongCollectionadd in class LongArrayListo - element to be appended to this list.public void add(int index,
long element)
add in interface LongListadd in class LongArrayListindex - index at which the specified element is to be inserted.element - element to be inserted.public boolean removeByValue(long value)
removeByValue in interface LongCollectionremoveByValue in class LongArrayListvalue - element to be removed from this list, if present.public boolean addAll(Collection<? extends Long> c)
addAll in interface Collection<Long>addAll in interface List<Long>addAll in class LongArrayListc - the elements to be inserted into this list.public boolean addAll(int index,
Collection<? extends Long> c)
addAll in interface List<Long>addAll in class LongArrayListindex - 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.