public static class FloatLists.Singleton extends AbstractFloatList implements java.io.Serializable, java.lang.Cloneable
This class may be useful to implement your own in case you subclass a type-specific list.
AbstractFloatList.FloatSubList
Modifier and Type | Method and Description |
---|---|
boolean |
addAll(java.util.Collection<? extends java.lang.Float> c)
Delegates to a more generic method.
|
boolean |
addAll(FloatCollection c)
Adds all elements of the given type-specific collection to this collection.
|
boolean |
addAll(int i,
java.util.Collection<? extends java.lang.Float> c) |
boolean |
addAll(int i,
FloatCollection c)
Delegates to a more generic method.
|
void |
clear() |
java.lang.Object |
clone() |
boolean |
contains(float k) |
float |
getFloat(int i) |
FloatListIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
FloatListIterator |
listIterator()
Returns a type-specific list iterator on the list.
|
FloatListIterator |
listIterator(int i)
Returns a type-specific list iterator on the list starting at a given index.
|
boolean |
rem(float k)
Note that this method should be called
remove() , but the clash
with the similarly named index-based method in the List interface
forces us to use a distinguished name. |
boolean |
removeAll(java.util.Collection<?> c)
Remove from this collection all elements in the given collection.
|
float |
removeFloat(int i) |
boolean |
retainAll(java.util.Collection<?> c)
Retains in this collection only elements from the given collection.
|
int |
size() |
void |
size(int size)
Sets the size 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. |
float[] |
toFloatArray()
Returns a primitive type array containing the items of this collection.
|
add, add, add, addAll, addAll, addElements, addElements, compareTo, equals, floatListIterator, floatListIterator, floatSubList, get, getElements, hashCode, indexOf, indexOf, lastIndexOf, lastIndexOf, peek, peekFloat, pop, popFloat, push, push, remove, remove, removeElements, set, set, top, topFloat, toString
add, contains, containsAll, containsAll, floatIterator, isEmpty, rem, removeAll, retainAll, toArray, toArray, toArray, toFloatArray
add, contains, containsAll, isEmpty, replaceAll, sort, spliterator, toArray, toArray
containsAll, floatIterator, removeAll, retainAll, toArray, toArray, toFloatArray
public float getFloat(int i)
public float removeFloat(int i)
removeFloat
in interface FloatList
removeFloat
in class AbstractFloatList
List.remove(int)
public boolean contains(float k)
contains
in interface FloatCollection
contains
in class AbstractFloatList
Collection.contains(Object)
public boolean addAll(java.util.Collection<? extends java.lang.Float> c)
AbstractFloatList
addAll
in interface java.util.Collection<java.lang.Float>
addAll
in interface java.util.List<java.lang.Float>
addAll
in class AbstractFloatList
c
- a collection.true
if this collection changed as a result of the call.public boolean addAll(int i, java.util.Collection<? extends java.lang.Float> c)
addAll
in interface java.util.List<java.lang.Float>
addAll
in class AbstractFloatList
public boolean removeAll(java.util.Collection<?> c)
AbstractFloatCollection
removeAll
in interface java.util.Collection<java.lang.Float>
removeAll
in interface java.util.List<java.lang.Float>
removeAll
in class AbstractFloatCollection
c
- a collection.true
if this collection changed as a result of the call.public boolean retainAll(java.util.Collection<?> c)
AbstractFloatCollection
retainAll
in interface java.util.Collection<java.lang.Float>
retainAll
in interface java.util.List<java.lang.Float>
retainAll
in class AbstractFloatCollection
c
- a collection.true
if this collection changed as a result of the call.public float[] toFloatArray()
FloatCollection
toFloatArray
in interface FloatCollection
toFloatArray
in class AbstractFloatCollection
Collection.toArray()
public FloatListIterator listIterator()
FloatList
listIterator
in interface FloatList
listIterator
in interface java.util.List<java.lang.Float>
listIterator
in class AbstractFloatList
List.listIterator()
public FloatListIterator iterator()
FloatCollection
Note that this specification strengthens the one given in
Iterable.iterator()
, which was already
strengthened in the corresponding type-specific class,
but was weakened by the fact that this interface extends Collection
.
iterator
in interface FloatCollection
iterator
in interface FloatIterable
iterator
in interface FloatList
iterator
in interface java.lang.Iterable<java.lang.Float>
iterator
in interface java.util.Collection<java.lang.Float>
iterator
in interface java.util.List<java.lang.Float>
iterator
in class AbstractFloatList
public FloatListIterator listIterator(int i)
FloatList
listIterator
in interface FloatList
listIterator
in interface java.util.List<java.lang.Float>
listIterator
in class AbstractFloatList
List.listIterator(int)
public FloatList subList(int from, int to)
FloatList
from
, inclusive, to the index to
, exclusive.
Note that this specification strengthens the one given in List.subList(int,int)
.
subList
in interface FloatList
subList
in interface java.util.List<java.lang.Float>
subList
in class AbstractFloatList
List.subList(int,int)
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 size(int size)
FloatList
If the specified size is smaller than the current size, the last elements are
discarded. Otherwise, they are filled with 0/null
/false
.
size
in interface FloatList
size
in class AbstractFloatList
size
- the new size.public void clear()
clear
in interface java.util.Collection<java.lang.Float>
clear
in interface java.util.List<java.lang.Float>
clear
in class java.util.AbstractCollection<java.lang.Float>
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean rem(float k)
FloatCollection
remove()
, but the clash
with the similarly named index-based method in the List
interface
forces us to use a distinguished name. For simplicity, the set interfaces reinstates
remove()
.rem
in interface FloatCollection
rem
in class AbstractFloatList
Collection.remove(Object)
public boolean addAll(FloatCollection c)
AbstractFloatCollection
addAll
in interface FloatCollection
addAll
in class AbstractFloatList
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.addAll(Collection)
public boolean addAll(int i, FloatCollection c)
AbstractFloatList
addAll
in interface FloatList
addAll
in class AbstractFloatList
List.add(int,Object)