public static class DoubleLists.Singleton extends AbstractDoubleList implements java.io.Serializable, java.lang.Cloneable
This class may be useful to implement your own in case you subclass a type-specific list.
AbstractDoubleList.DoubleSubList
Modifier and Type | Method and Description |
---|---|
boolean |
addAll(java.util.Collection<? extends java.lang.Double> c)
Delegates to a more generic method.
|
boolean |
addAll(DoubleCollection c)
Adds all elements of the given type-specific collection to this collection.
|
boolean |
addAll(int i,
java.util.Collection<? extends java.lang.Double> c) |
boolean |
addAll(int i,
DoubleCollection c)
Delegates to a more generic method.
|
void |
clear() |
java.lang.Object |
clone() |
boolean |
contains(double k) |
double |
getDouble(int i) |
DoubleListIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
DoubleListIterator |
listIterator()
Returns a type-specific list iterator on the list.
|
DoubleListIterator |
listIterator(int i)
Returns a type-specific list iterator on the list starting at a given index.
|
boolean |
rem(double 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.
|
double |
removeDouble(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.
|
DoubleList |
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. |
double[] |
toDoubleArray()
Returns a primitive type array containing the items of this collection.
|
add, add, add, addAll, addAll, addElements, addElements, compareTo, doubleListIterator, doubleListIterator, doubleSubList, equals, get, getElements, hashCode, indexOf, indexOf, lastIndexOf, lastIndexOf, peek, peekDouble, pop, popDouble, push, push, remove, remove, removeElements, set, set, top, topDouble, toString
add, contains, containsAll, containsAll, doubleIterator, isEmpty, rem, removeAll, retainAll, toArray, toArray, toArray, toDoubleArray
add, contains, containsAll, isEmpty, replaceAll, sort, spliterator, toArray, toArray
containsAll, doubleIterator, removeAll, retainAll, toArray, toArray, toDoubleArray
public double getDouble(int i)
getDouble
in interface DoubleList
List.get(int)
public double removeDouble(int i)
removeDouble
in interface DoubleList
removeDouble
in class AbstractDoubleList
List.remove(int)
public boolean contains(double k)
contains
in interface DoubleCollection
contains
in class AbstractDoubleList
Collection.contains(Object)
public boolean addAll(java.util.Collection<? extends java.lang.Double> c)
AbstractDoubleList
addAll
in interface java.util.Collection<java.lang.Double>
addAll
in interface java.util.List<java.lang.Double>
addAll
in class AbstractDoubleList
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.Double> c)
addAll
in interface java.util.List<java.lang.Double>
addAll
in class AbstractDoubleList
public boolean removeAll(java.util.Collection<?> c)
AbstractDoubleCollection
removeAll
in interface java.util.Collection<java.lang.Double>
removeAll
in interface java.util.List<java.lang.Double>
removeAll
in class AbstractDoubleCollection
c
- a collection.true
if this collection changed as a result of the call.public boolean retainAll(java.util.Collection<?> c)
AbstractDoubleCollection
retainAll
in interface java.util.Collection<java.lang.Double>
retainAll
in interface java.util.List<java.lang.Double>
retainAll
in class AbstractDoubleCollection
c
- a collection.true
if this collection changed as a result of the call.public double[] toDoubleArray()
DoubleCollection
toDoubleArray
in interface DoubleCollection
toDoubleArray
in class AbstractDoubleCollection
Collection.toArray()
public DoubleListIterator listIterator()
DoubleList
listIterator
in interface DoubleList
listIterator
in interface java.util.List<java.lang.Double>
listIterator
in class AbstractDoubleList
List.listIterator()
public DoubleListIterator iterator()
DoubleCollection
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 DoubleCollection
iterator
in interface DoubleIterable
iterator
in interface DoubleList
iterator
in interface java.lang.Iterable<java.lang.Double>
iterator
in interface java.util.Collection<java.lang.Double>
iterator
in interface java.util.List<java.lang.Double>
iterator
in class AbstractDoubleList
public DoubleListIterator listIterator(int i)
DoubleList
listIterator
in interface DoubleList
listIterator
in interface java.util.List<java.lang.Double>
listIterator
in class AbstractDoubleList
List.listIterator(int)
public DoubleList subList(int from, int to)
DoubleList
from
, inclusive, to the index to
, exclusive.
Note that this specification strengthens the one given in List.subList(int,int)
.
subList
in interface DoubleList
subList
in interface java.util.List<java.lang.Double>
subList
in class AbstractDoubleList
List.subList(int,int)
public int size()
size
in interface java.util.Collection<java.lang.Double>
size
in interface java.util.List<java.lang.Double>
size
in class java.util.AbstractCollection<java.lang.Double>
public void size(int size)
DoubleList
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 DoubleList
size
in class AbstractDoubleList
size
- the new size.public void clear()
clear
in interface java.util.Collection<java.lang.Double>
clear
in interface java.util.List<java.lang.Double>
clear
in class java.util.AbstractCollection<java.lang.Double>
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean rem(double k)
DoubleCollection
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 DoubleCollection
rem
in class AbstractDoubleList
Collection.remove(Object)
public boolean addAll(DoubleCollection c)
AbstractDoubleCollection
addAll
in interface DoubleCollection
addAll
in class AbstractDoubleList
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.addAll(Collection)
public boolean addAll(int i, DoubleCollection c)
AbstractDoubleList
addAll
in interface DoubleList
addAll
in class AbstractDoubleList
List.add(int,Object)