Class BooleanCollections.UnmodifiableCollection
- All Implemented Interfaces:
BooleanCollection,BooleanIterable,Serializable,Iterable<Boolean>,Collection<Boolean>
- Direct Known Subclasses:
BooleanBigLists.UnmodifiableBigList,BooleanLists.UnmodifiableList,BooleanSets.UnmodifiableSet
- Enclosing class:
- BooleanCollections
public static class BooleanCollections.UnmodifiableCollection extends Object implements BooleanCollection, Serializable
- See Also:
- Serialized Form
-
Method Summary
Modifier and Type Method Description booleanadd(boolean k)Ensures that this collection contains the specified element (optional operation).booleanadd(Boolean k)Deprecated.booleanaddAll(BooleanCollection c)Adds all elements of the given type-specific collection to this collection.booleanaddAll(Collection<? extends Boolean> c)voidclear()booleancontains(boolean o)Returnstrueif this collection contains the specified element.booleancontains(Object k)Deprecated.booleancontainsAll(BooleanCollection c)Checks whether this collection contains all elements from the given type-specific collection.booleancontainsAll(Collection<?> c)booleanequals(Object o)inthashCode()booleanisEmpty()BooleanIteratoriterator()Returns a type-specific iterator on the elements of this collection.booleanrem(boolean k)Removes a single instance of the specified element from this collection, if it is present (optional operation).booleanremove(Object k)Deprecated.booleanremoveAll(BooleanCollection c)Remove from this collection all elements in the given type-specific collection.booleanremoveAll(Collection<?> c)booleanretainAll(BooleanCollection c)Retains in this collection only elements from the given type-specific collection.booleanretainAll(Collection<?> c)intsize()Object[]toArray()boolean[]toArray(boolean[] 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)boolean[]toBooleanArray()Returns a primitive type array containing the items of this collection.boolean[]toBooleanArray(boolean[] a)Deprecated.StringtoString()Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
Method Details
-
add
public boolean add(boolean k)Description copied from interface:BooleanCollectionEnsures that this collection contains the specified element (optional operation).- Specified by:
addin interfaceBooleanCollection- See Also:
Collection.add(Object)
-
rem
public boolean rem(boolean k)Description copied from interface:BooleanCollectionRemoves 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 interfaceBooleanCollection- See Also:
Collection.remove(Object)
-
size
public int size()- Specified by:
sizein interfaceCollection<Boolean>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<Boolean>
-
contains
public boolean contains(boolean o)Description copied from interface:BooleanCollectionReturnstrueif this collection contains the specified element.- Specified by:
containsin interfaceBooleanCollection- See Also:
Collection.contains(Object)
-
iterator
Description copied from interface:BooleanCollectionReturns 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 interfaceBooleanCollection- Specified by:
iteratorin interfaceBooleanIterable- Specified by:
iteratorin interfaceCollection<Boolean>- Specified by:
iteratorin interfaceIterable<Boolean>- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Boolean>
-
toArray
public <T> T[] toArray(T[] a)- Specified by:
toArrayin interfaceCollection<Boolean>
-
toArray
- Specified by:
toArrayin interfaceCollection<Boolean>
-
containsAll
- Specified by:
containsAllin interfaceCollection<Boolean>
-
addAll
- Specified by:
addAllin interfaceCollection<Boolean>
-
removeAll
- Specified by:
removeAllin interfaceCollection<Boolean>
-
retainAll
- Specified by:
retainAllin interfaceCollection<Boolean>
-
add
Deprecated.Description copied from interface:BooleanCollection- Specified by:
addin interfaceBooleanCollection- Specified by:
addin interfaceCollection<Boolean>
-
contains
Deprecated.Description copied from interface:BooleanCollection- Specified by:
containsin interfaceBooleanCollection- Specified by:
containsin interfaceCollection<Boolean>
-
remove
Deprecated.Description copied from interface:BooleanCollection- Specified by:
removein interfaceBooleanCollection- Specified by:
removein interfaceCollection<Boolean>
-
toBooleanArray
public boolean[] toBooleanArray()Description copied from interface:BooleanCollectionReturns a primitive type array containing the items of this collection.- Specified by:
toBooleanArrayin interfaceBooleanCollection- Returns:
- a primitive type array containing the items of this collection.
- See Also:
Collection.toArray()
-
toBooleanArray
Deprecated.Description copied from interface:BooleanCollectionReturns 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:
toBooleanArrayin interfaceBooleanCollection- 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 boolean[] toArray(boolean[] a)Description copied from interface:BooleanCollectionReturns 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 interfaceBooleanCollection- 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
Description copied from interface:BooleanCollectionChecks whether this collection contains all elements from the given type-specific collection.- Specified by:
containsAllin interfaceBooleanCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection contains all elements of the argument.- See Also:
Collection.containsAll(Collection)
-
addAll
Description copied from interface:BooleanCollectionAdds all elements of the given type-specific collection to this collection.- Specified by:
addAllin interfaceBooleanCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
Collection.addAll(Collection)
-
removeAll
Description copied from interface:BooleanCollectionRemove from this collection all elements in the given type-specific collection.- Specified by:
removeAllin interfaceBooleanCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
Collection.removeAll(Collection)
-
retainAll
Description copied from interface:BooleanCollectionRetains in this collection only elements from the given type-specific collection.- Specified by:
retainAllin interfaceBooleanCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
Collection.retainAll(Collection)
-
toString
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<Boolean>- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceCollection<Boolean>- Overrides:
equalsin classObject
-