Class FloatCollections.UnmodifiableCollection
- java.lang.Object
-
- it.unimi.dsi.fastutil.floats.FloatCollections.UnmodifiableCollection
-
- All Implemented Interfaces:
FloatCollection,FloatIterable,Serializable,Iterable<Float>,Collection<Float>
- Direct Known Subclasses:
FloatBigLists.UnmodifiableBigList,FloatLists.UnmodifiableList,FloatSets.UnmodifiableSet
- Enclosing class:
- FloatCollections
public static class FloatCollections.UnmodifiableCollection extends Object implements FloatCollection, Serializable
An unmodifiable wrapper class for collections.- See Also:
- Serialized Form
-
-
Method Summary
Modifier and Type Method Description booleanadd(float k)Ensures that this collection contains the specified element (optional operation).booleanadd(Float k)Deprecated.booleanaddAll(FloatCollection c)Adds all elements of the given type-specific collection to this collection.booleanaddAll(Collection<? extends Float> c)voidclear()booleancontains(float o)Returnstrueif this collection contains the specified element.booleancontains(Object k)Deprecated.booleancontainsAll(FloatCollection c)Checks whether this collection contains all elements from the given type-specific collection.booleancontainsAll(Collection<?> c)booleanequals(Object o)inthashCode()booleanisEmpty()FloatIteratoriterator()Returns a type-specific iterator on the elements of this collection.booleanrem(float k)Removes a single instance of the specified element from this collection, if it is present (optional operation).booleanremove(Object k)Deprecated.booleanremoveAll(FloatCollection c)Remove from this collection all elements in the given type-specific collection.booleanremoveAll(Collection<?> c)booleanretainAll(FloatCollection c)Retains in this collection only elements from the given type-specific collection.booleanretainAll(Collection<?> c)intsize()Object[]toArray()float[]toArray(float[] a)Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.<T> T[]toArray(T[] a)float[]toFloatArray()Returns a primitive type array containing the items of this collection.float[]toFloatArray(float[] a)Deprecated.StringtoString()-
Methods inherited from interface java.util.Collection
parallelStream, spliterator, stream, toArray
-
Methods inherited from interface it.unimi.dsi.fastutil.floats.FloatCollection
removeIf, removeIf
-
Methods inherited from interface it.unimi.dsi.fastutil.floats.FloatIterable
forEach, forEach
-
-
-
-
Method Detail
-
add
public boolean add(float k)
Description copied from interface:FloatCollectionEnsures that this collection contains the specified element (optional operation).- Specified by:
addin interfaceFloatCollection- See Also:
Collection.add(Object)
-
rem
public boolean rem(float k)
Description copied from interface:FloatCollectionRemoves a single instance of the specified element from this collection, if it is present (optional operation).Note that this method should be called
remove(), but the clash with the similarly named index-based method in theListinterface forces us to use a distinguished name. For simplicity, the set interfaces reinstatesremove().- Specified by:
remin interfaceFloatCollection- See Also:
Collection.remove(Object)
-
size
public int size()
- Specified by:
sizein interfaceCollection<Float>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<Float>
-
contains
public boolean contains(float o)
Description copied from interface:FloatCollectionReturnstrueif this collection contains the specified element.- Specified by:
containsin interfaceFloatCollection- See Also:
Collection.contains(Object)
-
iterator
public FloatIterator iterator()
Description copied from interface:FloatCollectionReturns a type-specific iterator on the elements of this collection.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 extendsCollection.- Specified by:
iteratorin interfaceCollection<Float>- Specified by:
iteratorin interfaceFloatCollection- Specified by:
iteratorin interfaceFloatIterable- Specified by:
iteratorin interfaceIterable<Float>- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<Float>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfaceCollection<Float>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<Float>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<Float>
-
addAll
public boolean addAll(Collection<? extends Float> c)
- Specified by:
addAllin interfaceCollection<Float>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<Float>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<Float>
-
add
@Deprecated public boolean add(Float k)
Deprecated.Description copied from interface:FloatCollection- Specified by:
addin interfaceCollection<Float>- Specified by:
addin interfaceFloatCollection
-
contains
@Deprecated public boolean contains(Object k)
Deprecated.Description copied from interface:FloatCollection- Specified by:
containsin interfaceCollection<Float>- Specified by:
containsin interfaceFloatCollection
-
remove
@Deprecated public boolean remove(Object k)
Deprecated.Description copied from interface:FloatCollection- Specified by:
removein interfaceCollection<Float>- Specified by:
removein interfaceFloatCollection
-
toFloatArray
public float[] toFloatArray()
Description copied from interface:FloatCollectionReturns a primitive type array containing the items of this collection.- Specified by:
toFloatArrayin interfaceFloatCollection- Returns:
- a primitive type array containing the items of this collection.
- See Also:
Collection.toArray()
-
toFloatArray
@Deprecated public float[] toFloatArray(float[] a)
Deprecated.Description copied from interface:FloatCollectionReturns a primitive type array containing the items of this collection.Note that, contrarily to
Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.- Specified by:
toFloatArrayin interfaceFloatCollection- Parameters:
a- if this array is big enough, it will be used to store this collection.- Returns:
- a primitive type array containing the items of this collection.
- See Also:
Collection.toArray(Object[])
-
toArray
public float[] toArray(float[] a)
Description copied from interface:FloatCollectionReturns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.Note that, contrarily to
Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.- Specified by:
toArrayin interfaceFloatCollection- Parameters:
a- if this array is big enough, it will be used to store this collection.- Returns:
- a primitive type array containing the items of this collection.
- See Also:
Collection.toArray(Object[])
-
containsAll
public boolean containsAll(FloatCollection c)
Description copied from interface:FloatCollectionChecks whether this collection contains all elements from the given type-specific collection.- Specified by:
containsAllin interfaceFloatCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection contains all elements of the argument.- See Also:
Collection.containsAll(Collection)
-
addAll
public boolean addAll(FloatCollection c)
Description copied from interface:FloatCollectionAdds all elements of the given type-specific collection to this collection.- Specified by:
addAllin interfaceFloatCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
Collection.addAll(Collection)
-
removeAll
public boolean removeAll(FloatCollection c)
Description copied from interface:FloatCollectionRemove from this collection all elements in the given type-specific collection.- Specified by:
removeAllin interfaceFloatCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
Collection.removeAll(Collection)
-
retainAll
public boolean retainAll(FloatCollection c)
Description copied from interface:FloatCollectionRetains in this collection only elements from the given type-specific collection.- Specified by:
retainAllin interfaceFloatCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
Collection.retainAll(Collection)
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection<Float>- Overrides:
hashCodein classObject
-
-