Interface ObjectCollection<K>
-
- All Superinterfaces:
Collection<K>
,Iterable<K>
,ObjectIterable<K>
- All Known Subinterfaces:
Char2ObjectMap.FastEntrySet<V>
,ObjectList<K>
,ObjectSet<K>
- All Known Implementing Classes:
AbstractObjectCollection
,AbstractObjectList
,AbstractObjectList.ObjectSubList
,AbstractObjectSet
,ObjectArrayList
public interface ObjectCollection<K> extends Collection<K>, ObjectIterable<K>
A type-specificCollection
; provides some additional methods that use polymorphism to avoid (un)boxing.Additionally, this class defines strengthens (again)
iterator()
and defines a slightly different semantics fortoArray(Object[])
.- See Also:
Collection
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ObjectIterator<K>
iterator()
Returns a type-specific iterator on the elements of this collection.ObjectIterator<K>
objectIterator()
Deprecated.As offastutil
5, replaced byiterator()
.<T> T[]
toArray(T[] a)
Returns an containing the items of this collection; the runtime type of the returned array is that of the specified array.-
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
-
-
-
-
Method Detail
-
iterator
ObjectIterator<K> iterator()
Returns 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:
iterator
in interfaceCollection<K>
- Specified by:
iterator
in interfaceIterable<K>
- Specified by:
iterator
in interfaceObjectIterable<K>
- Returns:
- a type-specific iterator on the elements of this collection.
-
objectIterator
@Deprecated ObjectIterator<K> objectIterator()
Deprecated.As offastutil
5, replaced byiterator()
.Returns a type-specific iterator on this elements of this collection.- See Also:
iterator()
-
toArray
<T> T[] toArray(T[] a)
Returns an containing the items of this collection; the runtime type of the returned array is that of the specified array.Warning: 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:
toArray
in interfaceCollection<K>
- 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[])
-
-