|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.fastutil.ints.AbstractIntCollection
An abstract class providing basic methods for collections implementing a type-specific interface.
In particular, this class provide iterator()
, add(Object)
, remove(Object)
and
contains(Object)
methods that just call the type-specific counterpart.
Method Summary | |
boolean |
add(int k)
|
boolean |
add(Object o)
Delegates to the corresponding type-specific method. |
boolean |
addAll(Collection c)
Adds all elements of the given collection to this collection. |
boolean |
addAll(IntCollection c)
Adds all elements of the given type-specific collection to this collection. |
boolean |
contains(Object o)
Delegates to the corresponding type-specific method. |
boolean |
containsAll(Collection c)
Checks whether this collection contains all elements from the given collection. |
boolean |
containsAll(IntCollection c)
Checks whether this collection contains all elements from the given type-specific collection. |
boolean |
isEmpty()
|
Iterator |
iterator()
Delegates to the corresponding type-specific method. |
boolean |
rem(int k)
Note that this method should be just called remove() , but the clash
with the similarly named index-based method in the List interface
forces us to use a distinguished name. |
boolean |
remove(Object o)
Delegates to the corresponding type-specific method. |
boolean |
removeAll(Collection c)
Remove from this collection all elements in the given collection. |
boolean |
removeAll(IntCollection c)
Remove from this collection all elements in the given type-specific collection. |
boolean |
retainAll(Collection c)
Retains in this collection only elements from the given collection. |
boolean |
retainAll(IntCollection c)
Retains in this collection only elements from the given type-specific collection. |
Object[] |
toArray()
|
int[] |
toArray(int[] a)
Builds a primitive type array containing the items of this collection. |
Object[] |
toArray(Object[] a)
|
int[] |
toIntArray()
Returns a primitive type array containing the items of this collection. |
int[] |
toIntArray(int[] a)
Builds a primitive type array containing the items of this collection. |
String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface it.unimi.dsi.fastutil.ints.IntCollection |
contains, intIterator |
Methods inherited from interface java.util.Collection |
clear, equals, hashCode, size |
Method Detail |
public int[] toArray(int[] a)
IntCollection
toArray
in interface IntCollection
a
- if this array is big enough, it will be used to store the collection.
Collection.toArray(Object[])
public int[] toIntArray()
IntCollection
toIntArray
in interface IntCollection
Collection.toArray()
public int[] toIntArray(int[] a)
IntCollection
toIntArray
in interface IntCollection
a
- if this array is big enough, it will be used to store the collection.
Collection.toArray(Object[])
public boolean addAll(IntCollection c)
addAll
in interface IntCollection
c
- a type-specific collection.
true
if this collection changed as a result of the call.Collection.addAll(Collection)
public boolean containsAll(IntCollection c)
containsAll
in interface IntCollection
c
- a type-specific collection.
true
if this collection contains all elements of the argument.Collection.containsAll(Collection)
public boolean retainAll(IntCollection c)
retainAll
in interface IntCollection
c
- a type-specific collection.
true
if this collection changed as a result of the call.Collection.retainAll(Collection)
public boolean removeAll(IntCollection c)
removeAll
in interface IntCollection
c
- a type-specific collection.
true
if this collection changed as a result of the call.Collection.removeAll(Collection)
public Object[] toArray()
toArray
in interface Collection
public Object[] toArray(Object[] a)
toArray
in interface Collection
public boolean addAll(Collection c)
addAll
in interface Collection
c
- a collection.
true
if this collection changed as a result of the call.public boolean add(int k)
add
in interface IntCollection
Collection.add(Object)
public boolean rem(int k)
IntCollection
remove()
, but the clash
with the similarly named index-based method in the List
interface
forces us to use a distinguished name.
rem
in interface IntCollection
Collection.remove(Object)
public Iterator iterator()
iterator
in interface Collection
public boolean add(Object o)
add
in interface Collection
public boolean remove(Object o)
remove
in interface Collection
public boolean contains(Object o)
contains
in interface Collection
public boolean containsAll(Collection c)
containsAll
in interface Collection
c
- a collection.
true
if this collection contains all elements of the argument.public boolean retainAll(Collection c)
retainAll
in interface Collection
c
- a collection.
true
if this collection changed as a result of the call.public boolean removeAll(Collection c)
removeAll
in interface Collection
c
- a collection.
true
if this collection changed as a result of the call.public boolean isEmpty()
isEmpty
in interface Collection
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |