public static class AbstractLongList.LongSubList extends AbstractLongList implements java.io.Serializable
AbstractLongList.LongSubList
Constructor and Description |
---|
LongSubList(LongList l,
int from,
int to) |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
long k)
Inserts the specified element at the specified position in this list
(optional operation).
|
boolean |
add(long k)
Ensures that this collection contains the specified element (optional
operation).
|
boolean |
addAll(int index,
java.util.Collection<? extends java.lang.Long> c)
Adds all of the elements in the specified collection to this list (optional
operation).
|
boolean |
addAll(int index,
LongCollection c)
Inserts all of the elements in the specified type-specific collection into
this type-specific list at the specified position (optional operation).
|
boolean |
addAll(int index,
LongList l)
Inserts all of the elements in the specified type-specific list into this
type-specific list at the specified position (optional operation).
|
void |
addElements(int index,
long[] a,
int offset,
int length)
Add (hopefully quickly) elements to this type-specific list.
|
void |
getElements(int from,
long[] a,
int offset,
int length)
Copies (hopefully quickly) elements of this type-specific list into the given
array.
|
long |
getLong(int index)
Returns the element at the specified position in this list.
|
LongListIterator |
listIterator(int index)
Returns a type-specific list iterator on the list starting at a given index.
|
boolean |
rem(long k)
Removes a single instance of the specified element from this collection, if
it is present (optional operation).
|
void |
removeElements(int from,
int to)
Removes (hopefully quickly) elements of this type-specific list.
|
long |
removeLong(int index)
Removes the element at the specified position in this list (optional
operation).
|
long |
set(int index,
long k)
Replaces the element at the specified position in this list with the
specified element (optional operation).
|
int |
size() |
LongList |
subList(int from,
int to)
Returns a type-specific view of the portion of this list from the index
from , inclusive, to the index to , exclusive. |
addAll, addAll, addAll, addElements, clear, compareTo, contains, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, peekLong, popLong, push, size, topLong, toString
add, contains, containsAll, remove, removeAll, retainAll, toArray, toLongArray, toLongArray
containsAll, isEmpty, removeAll, retainAll, toArray, toArray
add, add, contains, get, indexOf, lastIndexOf, remove, remove, set
containsAll, isEmpty, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
containsAll, removeAll, removeIf, removeIf, retainAll, toArray, toLongArray, toLongArray
forEach, forEach
public LongSubList(LongList l, int from, int to)
public boolean add(long k)
AbstractLongList
This implementation always throws an UnsupportedOperationException
.
This implementation delegates to the type-specific version of
List.add(int, Object)
.
add
in interface LongCollection
add
in interface LongList
add
in class AbstractLongList
Collection.add(Object)
public void add(int index, long k)
AbstractLongList
This implementation always throws an UnsupportedOperationException
.
add
in interface LongList
add
in class AbstractLongList
List.add(int,Object)
public boolean addAll(int index, java.util.Collection<? extends java.lang.Long> c)
AbstractLongList
addAll
in interface java.util.List<java.lang.Long>
addAll
in class AbstractLongList
public long getLong(int index)
LongList
public long removeLong(int index)
AbstractLongList
This implementation always throws an UnsupportedOperationException
.
removeLong
in interface LongList
removeLong
in class AbstractLongList
List.remove(int)
public long set(int index, long k)
AbstractLongList
This implementation always throws an UnsupportedOperationException
.
set
in interface LongList
set
in class AbstractLongList
List.set(int,Object)
public int size()
size
in interface java.util.Collection<java.lang.Long>
size
in interface java.util.List<java.lang.Long>
size
in class java.util.AbstractCollection<java.lang.Long>
public void getElements(int from, long[] a, int offset, int length)
AbstractLongList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
getElements
in interface LongList
getElements
in class AbstractLongList
from
- the start index (inclusive).a
- the destination array.offset
- the offset into the destination array where to store the first
element copied.length
- the number of elements to be copied.public void removeElements(int from, int to)
AbstractLongList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements
in interface LongList
removeElements
in class AbstractLongList
from
- the start index (inclusive).to
- the end index (exclusive).public void addElements(int index, long[] a, int offset, int length)
AbstractLongList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
addElements
in interface LongList
addElements
in class AbstractLongList
index
- the index at which to add elements.a
- the array containing the elements.offset
- the offset of the first element to add.length
- the number of elements to add.public LongListIterator listIterator(int index)
AbstractLongList
This implementation is based on the random-access methods.
listIterator
in interface LongList
listIterator
in interface java.util.List<java.lang.Long>
listIterator
in class AbstractLongList
List.listIterator(int)
public LongList subList(int from, int to)
LongList
from
, inclusive, to the index to
, exclusive.
Note that this specification strengthens the one given in
List.subList(int,int)
.
subList
in interface LongList
subList
in interface java.util.List<java.lang.Long>
subList
in class AbstractLongList
List.subList(int,int)
public boolean rem(long k)
AbstractLongList
This implementation delegates to indexOf()
.
rem
in interface LongCollection
rem
in class AbstractLongList
List.remove(Object)
public boolean addAll(int index, LongCollection c)
LongList
addAll
in interface LongList
addAll
in class AbstractLongList
List.addAll(int,java.util.Collection)
public boolean addAll(int index, LongList l)
AbstractLongList
This implementation delegates to the type-specific version of
List.addAll(int, Collection)
.
addAll
in interface LongList
addAll
in class AbstractLongList
List.add(int,Object)