it.unimi.dsi.fastutil.ints
Interface IntCollection

All Superinterfaces:
Collection
All Known Subinterfaces:
IntList, IntSet, IntSortedSet
All Known Implementing Classes:
AbstractIntCollection, AbstractIntList, AbstractIntSet, IntAVLTreeSet, IntLinkedOpenHashSet, IntOpenHashSet, IntRBTreeSet

public interface IntCollection
extends Collection

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.

See Also:
Collection

Method Summary
 boolean add(int key)
           
 boolean addAll(IntCollection c)
           
 boolean contains(int key)
           
 boolean containsAll(IntCollection c)
           
 IntIterator intIterator()
          Returns a type-specific iterator on the collection.
 boolean rem(int key)
          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 removeAll(IntCollection c)
           
 boolean retainAll(IntCollection c)
           
 int[] toArray(int[] a)
          Builds a primitive type array containing the items of this collection.
 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.
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

intIterator

public IntIterator intIterator()
Returns a type-specific iterator on the collection.

The iterator returned by the Collection.iterator() method and by this method are identical; however, using this method you can save a type casting.

Since:
2.51
See Also:
Collection.iterator()

contains

public boolean contains(int key)
See Also:
Collection.contains(Object)

toIntArray

public int[] toIntArray()
Returns a primitive type array containing the items of this collection.

Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray()

toIntArray

public int[] toIntArray(int[] a)
Builds a primitive type array containing the items of this collection.

Parameters:
a - if this array is big enough, it will be used to store the collection.
Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray(Object[])

toArray

public int[] toArray(int[] a)
Builds a primitive type array containing the items of this collection.

Parameters:
a - if this array is big enough, it will be used to store the collection.
Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray(Object[])

add

public boolean add(int key)
See Also:
Collection.add(Object)

rem

public boolean rem(int key)
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.

See Also:
Collection.remove(Object)

addAll

public boolean addAll(IntCollection c)
See Also:
Collection.addAll(Collection)

containsAll

public boolean containsAll(IntCollection c)
See Also:
Collection.containsAll(Collection)

removeAll

public boolean removeAll(IntCollection c)
See Also:
Collection.removeAll(Collection)

retainAll

public boolean retainAll(IntCollection c)
See Also:
Collection.retainAll(Collection)