public static class AbstractFloatList.FloatSubList extends AbstractFloatList implements java.io.Serializable
AbstractFloatList.FloatRandomAccessSubList, AbstractFloatList.FloatSubList
Constructor and Description |
---|
FloatSubList(FloatList l,
int from,
int to) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(float k)
Ensures that this collection contains the specified element (optional operation).
|
void |
add(int index,
float k)
Inserts the specified element at the specified position in this list (optional operation).
|
boolean |
addAll(int index,
java.util.Collection<? extends java.lang.Float> c)
Adds all of the elements in the specified collection to this list (optional operation).
|
boolean |
addAll(int index,
FloatCollection 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,
FloatList 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,
float[] a,
int offset,
int length)
Add (hopefully quickly) elements to this type-specific list.
|
void |
getElements(int from,
float[] a,
int offset,
int length)
Copies (hopefully quickly) elements of this type-specific list into the given array.
|
float |
getFloat(int index)
Returns the element at the specified position in this list.
|
FloatListIterator |
listIterator(int index)
Returns a type-specific list iterator on the list starting at a given index.
|
boolean |
rem(float 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.
|
float |
removeFloat(int index)
Removes the element at the specified position in this list (optional operation).
|
float |
set(int index,
float k)
Replaces the element at the specified position in this list with the specified element (optional operation).
|
void |
setElements(int index,
float[] a,
int offset,
int length)
Set (hopefully quickly) elements to match the array given.
|
int |
size() |
FloatSpliterator |
spliterator()
Returns a type-specific spliterator on the elements of this list.
|
FloatList |
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, addElements, clear, compareTo, contains, equals, forEach, hashCode, indexOf, iterator, lastIndexOf, listIterator, peekFloat, popFloat, push, size, toArray, toFloatArray, topFloat, toString
add, contains, containsAll, containsAll, remove, removeAll, removeAll, retainAll, retainAll, toFloatArray
add, add, addAll, contains, get, indexOf, lastIndexOf, of, of, of, of, of, remove, remove, replaceAll, replaceAll, replaceAll, set, setElements, setElements, sort, sort, unstableSort, unstableSort
containsAll, isEmpty, removeAll, retainAll, toArray, toArray
containsAll, doubleIterator, doubleParallelStream, doubleSpliterator, doubleStream, parallelStream, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toFloatArray
forEach, forEach
peek, pop, push, top
public FloatSubList(FloatList l, int from, int to)
public boolean add(float k)
AbstractFloatList
add
in interface FloatCollection
add
in interface FloatList
add
in class AbstractFloatList
Collection.add(Object)
public void add(int index, float k)
AbstractFloatList
add
in interface FloatList
add
in class AbstractFloatList
List.add(int,Object)
public boolean addAll(int index, java.util.Collection<? extends java.lang.Float> c)
AbstractFloatList
addAll
in interface java.util.List<java.lang.Float>
addAll
in class AbstractFloatList
public float getFloat(int index)
FloatList
public float removeFloat(int index)
AbstractFloatList
removeFloat
in interface FloatList
removeFloat
in class AbstractFloatList
List.remove(int)
public float set(int index, float k)
AbstractFloatList
set
in interface FloatList
set
in class AbstractFloatList
List.set(int,Object)
public int size()
size
in interface java.util.Collection<java.lang.Float>
size
in interface java.util.List<java.lang.Float>
size
in class java.util.AbstractCollection<java.lang.Float>
public void getElements(int from, float[] a, int offset, int length)
AbstractFloatList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
getElements
in interface FloatList
getElements
in class AbstractFloatList
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)
AbstractFloatList
This is a trivial iterator-based based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements
in interface FloatList
removeElements
in class AbstractFloatList
from
- the start index (inclusive).to
- the end index (exclusive).public void addElements(int index, float[] a, int offset, int length)
AbstractFloatList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
addElements
in interface FloatList
addElements
in class AbstractFloatList
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 void setElements(int index, float[] a, int offset, int length)
FloatList
ListIterator iter = listIterator(index);
int i = 0;
while (i < length) {
iter.next();
iter.set(a[offset + i++]);
}
However, the exact implementation may be more efficient, taking into account
whether random access is faster or not, or at the discretion of subclasses,
abuse internals.setElements
in interface FloatList
setElements
in class AbstractFloatList
index
- the index at which to start setting elements.a
- the array containing the elementsoffset
- the offset of the first element to add.length
- the number of elements to add.public FloatListIterator listIterator(int index)
AbstractFloatList
listIterator
in interface FloatList
listIterator
in interface java.util.List<java.lang.Float>
listIterator
in class AbstractFloatList
List.listIterator(int)
public FloatSpliterator spliterator()
FloatList
List spliterators must report at least Spliterator.SIZED
and Spliterator.ORDERED
.
See List.spliterator()
for more documentation on the requirements
of the returned spliterator.
spliterator
in interface FloatCollection
spliterator
in interface FloatIterable
spliterator
in interface FloatList
spliterator
in interface java.lang.Iterable<java.lang.Float>
spliterator
in interface java.util.Collection<java.lang.Float>
spliterator
in interface java.util.List<java.lang.Float>
public FloatList subList(int from, int to)
FloatList
from
, inclusive, to the index to
, exclusive.subList
in interface FloatList
subList
in interface java.util.List<java.lang.Float>
subList
in class AbstractFloatList
List.subList(int,int)
public boolean rem(float k)
AbstractFloatList
rem
in interface FloatCollection
rem
in class AbstractFloatList
List.remove(Object)
public boolean addAll(int index, FloatCollection c)
FloatList
addAll
in interface FloatList
addAll
in class AbstractFloatList
List.addAll(int,java.util.Collection)