|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A type-specific Collection
; provides some additional methods
that use polymorphism to reduce type juggling.
Note that iterators provided by classes implementing this interface must be type specific.
Collection
Method Summary | |
boolean |
add(boolean key)
|
boolean |
addAll(BooleanCollection c)
|
BooleanIterator |
booleanIterator()
Returns a type-specific iterator on the collection. |
boolean |
contains(boolean key)
|
boolean |
containsAll(BooleanCollection c)
|
boolean |
rem(boolean key)
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(BooleanCollection c)
|
boolean |
retainAll(BooleanCollection c)
|
boolean[] |
toArray(boolean[] a)
Builds a primitive type array containing the items of this collection. |
boolean[] |
toBooleanArray()
Returns a primitive type array containing the items of this collection. |
boolean[] |
toBooleanArray(boolean[] a)
Builds a primitive type array containing the items of this collection. |
Methods inherited from interface java.util.Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Method Detail |
public BooleanIterator booleanIterator()
The iterator returned by the Collection.iterator()
method and by this
method are identical; however, using this method you can save a type casting.
Collection.iterator()
public boolean contains(boolean key)
Collection.contains(Object)
public boolean[] toBooleanArray()
Collection.toArray()
public boolean[] toBooleanArray(boolean[] a)
a
- if this array is big enough, it will be used to store the collection.
Collection.toArray(Object[])
public boolean[] toArray(boolean[] a)
a
- if this array is big enough, it will be used to store the collection.
Collection.toArray(Object[])
public boolean add(boolean key)
Collection.add(Object)
public boolean rem(boolean key)
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()
.
Collection.remove(Object)
public boolean addAll(BooleanCollection c)
Collection.addAll(Collection)
public boolean containsAll(BooleanCollection c)
Collection.containsAll(Collection)
public boolean removeAll(BooleanCollection c)
Collection.removeAll(Collection)
public boolean retainAll(BooleanCollection c)
Collection.retainAll(Collection)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |