@Generated(value="Autogenerated by OpenJAX CodeGen Template (0.2.5)", date="2020-05-23") public interface LongList extends LongCollection
long
values.
This interface is a replica of the List
interface that
defines synonymous methods for a list of long
values instead of
Object references.
Modifier and Type | Method and Description |
---|---|
boolean |
add(int index,
long value)
Inserts the specified value at the specified position in this list.
|
boolean |
add(long value)
Appends the specified value to the end of this list.
|
boolean |
addAll(Collection<Long> c)
Appends all of the values in the specified collection to the end of this
list, in the order that they are returned by the specified collection's
iterator.
|
boolean |
addAll(int index,
Collection<Long> c)
Appends all of the values in the specified collection to the end of this
list, in the order that they are returned by the specified collection's
iterator.
|
default boolean |
addAll(int index,
long[] values)
Appends all of the values in the specified array to the end of this list,
in the order that they appear in the array.
|
boolean |
addAll(int index,
long[] values,
int offset,
int length)
Appends all of the values in the specified array to the end of this list,
in the order that they appear in the array.
|
boolean |
addAll(int index,
LongCollection c)
Appends all of the values in the specified collection to the end of this
list, in the order that they are returned by the specified collection's
iterator.
|
default boolean |
addAll(long... values)
Appends all of the values in the specified array to the end of this list,
in the order that they appear in the array.
|
boolean |
addAll(long[] values,
int offset,
int length)
Appends all of the values in the specified array to the end of this list,
in the order that they appear in the array.
|
boolean |
addAll(LongCollection c)
Appends all of the values in the specified collection to the end of this
list, in the order that they are returned by the specified collection's
iterator.
|
void |
clear()
Removes all of the elements from this list.
|
default boolean |
contains(long value)
Returns
true if this list contains the specified value. |
default boolean |
containsAll(long... values)
Returns
true if this collection contains all of the values in the
specified array. |
boolean |
equals(Object obj)
Compares the specified object with this list for equality.
|
long |
get(int index)
Returns the value at the specified position in this list.
|
int |
hashCode()
Returns the hash code value for this list.
|
int |
indexOf(long value)
Returns the index of the first occurrence of the specified value in this
list, or -1 if this list does not contain the value.
|
boolean |
isEmpty()
Returns
true if this list contains no values. |
LongIterator |
iterator()
Returns an iterator over the values in this list in proper sequence.
|
int |
lastIndexOf(long value)
Returns the index of the last occurrence of the specified value in this
list, or -1 if this list does not contain the value.
|
default LongListIterator |
listIterator()
Returns a long list iterator over the values in this list (in proper
sequence).
|
LongListIterator |
listIterator(int index)
Returns a long list iterator over the values in this list (in proper
sequence), starting at the specified position in the list.
|
default long |
peek()
Looks at the value at the top of this list without removing it from the
list.
|
default long |
pop()
Removes the value at the top of this list and returns that value.
|
default long |
push(long value)
Pushes an item onto the top of this list.
|
default boolean |
remove(long value)
Removes the first occurrence of the specified value from this list, if it
is present.
|
default boolean |
removeAll(Collection<Long> c)
Removes from this list all of its values that are contained in the
specified
Collection . |
default boolean |
removeAll(long... values)
Removes from this list all of its values that are contained in the
specified array.
|
default boolean |
removeAll(LongCollection c)
Removes from this list all of its values that are contained in the
specified collection.
|
long |
removeIndex(int index)
Removes the value at the specified index in this list.
|
default void |
replaceAll(LongUnaryOperator operator)
Replaces each value of this list with the result of applying the operator
to that value.
|
boolean |
retainAll(Collection<Long> c)
Retains only the values in this list that are contained in the specified
collection.
|
boolean |
retainAll(LongCollection c)
Retains only the values in this list that are contained in the specified
collection.
|
long |
set(int index,
long value)
Replaces the value at the specified position in this list with the
specified value.
|
int |
size()
Returns the number of values in this list.
|
default void |
sort()
Sorts the list into ascending order.
|
default void |
sort(List<?> p)
Sorts the specified paired list according to the order induced by the
specified comparator applied to the values in this list.
|
default void |
sort(List<?> p,
LongComparator c)
Sorts the specified paired list according to the order induced by the
specified comparator applied to the values in this list.
|
void |
sort(LongComparator c)
Sorts the specified list according to the order induced by the specified
comparator.
|
default void |
sort(Object[] p)
Sorts the specified paired array according to the order induced by the
specified comparator applied to the values in this list.
|
default void |
sort(Object[] p,
LongComparator c)
Sorts this specified paired array according to the order induced by the
specified comparator applied to the values in this list.
|
LongList |
subList(int fromIndex,
int toIndex)
Returns a view of the portion of this list between the specified
fromIndex , inclusive, and toIndex , exclusive. |
containsAll, containsAll, parallelStream, removeIf, spliterator, stream, toArray, toArray, toArray
default long push(long value)
add(value)
value
- The value to be pushed onto this list.value
argument.add(long)
default long pop()
removeIndex(size() - 1)
LongList
object).IndexOutOfBoundsException
- If this list is empty.default long peek()
get(size() - 1)
LongList
object).IndexOutOfBoundsException
- If this list is empty.long get(int index)
index
- Index of the value to return.IndexOutOfBoundsException
- If the index is out of range
(index < 0 || size() < index
).boolean add(long value)
add
in interface LongCollection
value
- Value to be appended to this list.true
if this list changed as a result of the call.boolean add(int index, long value)
index
- Index at which the specified value is to be insertedvalue
- Value to be inserted.true
if this list changed as a result of the call.IndexOutOfBoundsException
- If the index is out of range
(index < 0 || size() < index
).boolean addAll(int index, long[] values, int offset, int length)
index
- Index at which to insert the first value from the specified
array.values
- Array containing values to be added to this list.offset
- The index of the first value to add.length
- The number of values to add.true
if this list changed as a result of the call.IndexOutOfBoundsException
- If the index is out of range
(index < 0 || size() < index
), or if the offset or length
are out of range
(offset < 0 || values.length < offset + length
).NullPointerException
- If the specified array is null.default boolean addAll(int index, long[] values)
index
- Index at which to insert the first value from the specified
array.values
- Array containing values to be added to this list.true
if this list changed as a result of the call.IndexOutOfBoundsException
- If the index is out of range
(index < 0 || size() < index
).NullPointerException
- If the specified array is null.boolean addAll(long[] values, int offset, int length)
values
- Array containing values to be added to this list.offset
- The index of the first value to add.length
- The number of values to add.true
if this list changed as a result of the call.IndexOutOfBoundsException
- If the offset or length are out of range
(offset < 0 || values.length < offset + length
).NullPointerException
- If the specified array is null.default boolean addAll(long... values)
addAll
in interface LongCollection
values
- Array containing values to be added to this list.true
if this list changed as a result of the call.NullPointerException
- If the specified array is null.boolean addAll(int index, Collection<Long> c)
index
- Index at which to insert the first value from the specified
collection.c
- Collection containing values to be added to this list.true
if this list changed as a result of the call.IndexOutOfBoundsException
- If the index is out of range
(index < 0 || size() < index
).ClassCastException
- If the class of an element of the specified
collection is not Long
.NullPointerException
- If the specified collection is null, or if the
collection contains a null element.boolean addAll(Collection<Long> c)
addAll
in interface LongCollection
c
- Collection containing values to be added to this list.true
if this list changed as a result of the call.ClassCastException
- If the class of an element of the specified
collection is not Long
.NullPointerException
- If the specified collection is null, or if the
collection contains a null element.boolean addAll(int index, LongCollection c)
index
- Index at which to insert the first value from the specified
collection.c
- Collection containing values to be added to this list.true
if this list changed as a result of the call.IndexOutOfBoundsException
- If the index is out of range
(index < 0 || size() < index
).NullPointerException
- If the specified collection is null.boolean addAll(LongCollection c)
addAll
in interface LongCollection
c
- Collection containing values to be added to this list.true
if this list changed as a result of the call.NullPointerException
- If the specified collection is null.long set(int index, long value)
index
- Index of the value to replace.value
- Value to be stored at the specified position.IndexOutOfBoundsException
- If the index is out of range
(index < 0 || size() < index
).long removeIndex(int index)
index
- The index of the value to be removed.IndexOutOfBoundsException
- If the index is out of range
(index < 0 || size() < index
).default boolean remove(long value)
i
such that
Objects.equals(o, get(i))
(if such an value exists). Returns
true
if this list contained the specified value (or equivalently,
if this list changed as a result of the call).remove
in interface LongCollection
value
- Value to be removed from this list, if present.true
if this list contained the specified value.default boolean removeAll(long... values)
removeAll
in interface LongCollection
values
- Values to be removed from this list.true
if this list changed as a result of the call.remove(long)
,
contains(long)
default boolean removeAll(LongCollection c)
removeAll
in interface LongCollection
c
- Collection containing values to be removed from this list.true
if this list changed as a result of the call.NullPointerException
- If the specified collection is null.remove(long)
,
contains(long)
default boolean removeAll(Collection<Long> c)
Collection
.removeAll
in interface LongCollection
c
- Collection containing values to be removed from this list.true
if this list changed as a result of the call.ClassCastException
- If the class of an element of the specified
collection is not Long
.NullPointerException
- If the specified collection is null, or if the
collection contains a null element.remove(long)
,
contains(long)
boolean retainAll(Collection<Long> c)
retainAll
in interface LongCollection
c
- Collection containing values to be retained in this list.true
if this list changed as a result of the call.ClassCastException
- If the class of an element of the specified
collection is not Long
.NullPointerException
- If the specified collection contains a null
value, or if the specified collection is null.remove(long)
,
contains(long)
boolean retainAll(LongCollection c)
retainAll
in interface LongCollection
c
- Collection containing values to be retained in this list.true
if this list changed as a result of the call.NullPointerException
- If the specified collection contains a null
value, or if the specified collection is null.remove(long)
,
contains(long)
default void replaceAll(LongUnaryOperator operator)
If the list's list-iterator does not support the set
operation,
then an UnsupportedOperationException
will be thrown when replacing
the first value.
operator
- The operator to apply to each value.NullPointerException
- If the specified operator is null.default boolean contains(long value)
true
if this list contains the specified value. More
formally, returns true
if and only if this list contains at least
one value v
such that Objects.equals(o, e)
.contains
in interface LongCollection
value
- Value whose presence in this list is to be tested.true
if this list contains the specified value.default boolean containsAll(long... values)
true
if this collection contains all of the values in the
specified array.values
- Array to be checked for containment in this collection.true
if this collection contains all of the values in the
specified collection.contains(long)
int indexOf(long value)
i
such that value == get(i)
, or -1 if
there is no such value.value
- Value to search for.int lastIndexOf(long value)
i
such that value == get(i)
, or -1 if
there is no such value.value
- Value to search for.LongIterator iterator()
iterator
in interface LongIterable
default LongListIterator listIterator()
LongListIterator listIterator(int index)
next
. An initial call to
previous
would return the value with the
specified index minus one.index
- Index of the first value to be returned from the long list
iterator (by a call to next
).IndexOutOfBoundsException
- If the index is out of range
(index < 0 || index > size()
).int size()
Long.MAX_VALUE
values, returns Long.MAX_VALUE
.size
in interface PrimitiveCollection
boolean isEmpty()
true
if this list contains no values.isEmpty
in interface PrimitiveCollection
true
if this list contains no values.default void sort()
void sort(LongComparator c)
c
- The comparator to determine the order of the list.default void sort(Object[] p)
This method will result in this and the specified paired list to be sorted in tandem.
For example, this
and p
are initialized to:
this: 6 8 9 7 4 0 2 3 1 5 p: g i j h e a c d b fAfter
sort(p)
is called:
this: 0 1 2 3 4 5 6 7 8 9 p: a b c d e f g h i j
p
- The paired array that is to be sorted in tandem with this list.default void sort(Object[] p, LongComparator c)
This method will result in this and the specified paired list to be sorted in tandem.
For example, this
and p
are initialized to:
this: 6 8 9 7 4 0 2 3 1 5 p: g i j h e a c d b fAfter
sort(p)
is called:
this: 0 1 2 3 4 5 6 7 8 9 p: a b c d e f g h i j
p
- The paired array that is to be sorted in tandem with this list.c
- The comparator to determine the order of this and the paired array.IllegalArgumentException
- If the length of the paired list does not
match that of this list.default void sort(List<?> p)
This method will result in this and the specified paired list to be sorted in tandem.
p
- The paired list that is to be sorted in tandem with this list.default void sort(List<?> p, LongComparator c)
This method will result in this and the specified paired list to be sorted in tandem.
p
- The paired list that is to be sorted in tandem with this list.c
- The comparator to determine the order of this and the paired list.IllegalArgumentException
- If the length of the paired list does not
match that of this list.void clear()
clear
in interface PrimitiveCollection
LongList subList(int fromIndex, int toIndex)
fromIndex
, inclusive, and toIndex
, exclusive. (If
fromIndex
and toIndex
are equal, the returned list is
empty). The returned list is backed by this list, so non-structural, or
structural, changes in the returned list are reflected in this list,
and vice-versa. The returned list supports all of the optional list
operations supported by this list.
This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:
list.subList(from, to).clear();
Similar idioms may be constructed for indexOf
and
lastIndexOf
, and all of the algorithms in the LongList
class can be applied to a subList.
The semantics of the list returned by this method are defined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. Structural modifications are those that change the size of this list.
fromIndex
of the sub-list, the range indexes of the sub-list will
increase by 1.fromIndex
of the sub-list, the range indexes of the sub-list will
reduce by 1.fromIndex
- Low endpoint (inclusive) of the subList.toIndex
- High endpoint (exclusive) of the subList.IndexOutOfBoundsException
- For range parameters that are
out-of-bounds (fromIndex < 0 || toIndex > size ||
fromIndex > toIndex
).boolean equals(Object obj)
true
if and only if the specified object is also a list, both lists
have the same size, and all corresponding pairs of values in the two lists
are equal. (Two values v1
and v2
are equal if
v1 == v2
.) In other words, two lists are defined to be equal if
they contain the same values in the same order.equals
in interface PrimitiveCollection
equals
in class Object
obj
- The object to be compared for equality with this list.true
if the specified object is equal to this list.Object.equals(Object)
,
IntSet.equals(Object)
,
IntList.equals(Object)
int hashCode()
List.hashCode()
.hashCode
in interface PrimitiveCollection
hashCode
in class Object
Object.equals(Object)
,
equals(Object)
Copyright © 2020 LibJ. All rights reserved.