public static class FloatSets.Singleton extends AbstractFloatSet implements Serializable, Cloneable
This class may be useful to implement your own in case you subclass a type-specific set.
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAll(Collection<? extends Float> c) |
boolean |
addAll(FloatCollection c)
Adds all elements of the given type-specific collection to this collection.
|
Object |
clone() |
boolean |
contains(float k)
Returns
true if this collection contains the specified element. |
FloatListIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
remove(float k)
Removes an element from this set.
|
boolean |
removeAll(Collection<?> c) |
boolean |
removeAll(FloatCollection c)
Remove from this collection all elements in the given type-specific collection.
|
boolean |
retainAll(Collection<?> c) |
boolean |
retainAll(FloatCollection c)
Retains in this collection only elements from the given type-specific collection.
|
int |
size() |
equals, hashCode, remadd, add, contains, containsAll, remove, toArray, toFloatArray, toFloatArray, toStringclear, containsAll, isEmpty, toArray, toArrayadd, containsAll, removeIf, removeIf, toArray, toFloatArray, toFloatArrayforEach, forEachclear, containsAll, isEmpty, spliterator, toArray, toArrayparallelStream, streampublic boolean contains(float k)
AbstractFloatCollectiontrue if this collection contains the specified element.
This implementation iterates over the elements in the collection, looking for the specified element.
contains in interface FloatCollectioncontains in class AbstractFloatCollectionCollection.contains(Object)public boolean remove(float k)
AbstractFloatSetNote that the corresponding method of a type-specific collection is rem().
This unfortunate situation is caused by the clash
with the similarly named index-based method in the List interface.
Delegates to the type-specific rem() method
implemented by type-specific abstract Collection superclass.
remove in interface FloatSetremove in class AbstractFloatSetCollection.remove(Object)public FloatListIterator iterator()
FloatCollectionNote 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 FloatCollectioniterator in interface FloatIterableiterator in interface FloatSetiterator in interface Iterable<Float>iterator in interface Collection<Float>iterator in interface Set<Float>iterator in class AbstractFloatSetIterable.iterator()public int size()
size in interface Collection<Float>size in interface Set<Float>size in class AbstractCollection<Float>public boolean addAll(Collection<? extends Float> c)
addAll in interface Collection<Float>addAll in interface Set<Float>addAll in class AbstractCollection<Float>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<Float>removeAll in interface Set<Float>removeAll in class AbstractCollection<Float>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<Float>retainAll in interface Set<Float>retainAll in class AbstractCollection<Float>public boolean addAll(FloatCollection c)
FloatCollectionaddAll in interface FloatCollectionaddAll in class AbstractFloatCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.addAll(Collection)public boolean removeAll(FloatCollection c)
FloatCollectionremoveAll in interface FloatCollectionremoveAll in class AbstractFloatCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.removeAll(Collection)public boolean retainAll(FloatCollection c)
FloatCollectionretainAll in interface FloatCollectionretainAll in class AbstractFloatCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.retainAll(Collection)