Interface ObjectSet<K>
-
- All Superinterfaces:
Collection<K>
,Iterable<K>
,ObjectCollection<K>
,ObjectIterable<K>
,Set<K>
- All Known Subinterfaces:
Char2ObjectMap.FastEntrySet<V>
- All Known Implementing Classes:
AbstractObjectSet
public interface ObjectSet<K> extends ObjectCollection<K>, Set<K>
A type-specificSet
; provides some additional methods that use polymorphism to avoid (un)boxing.Additionally, this interface strengthens (again)
iterator()
.- See Also:
Set
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObjectIterator<K>
iterator()
Returns a type-specific iterator on the elements of this set.boolean
remove(Object k)
Removes an element from this set.-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface org.codelibs.jhighlight.fastutil.objects.ObjectCollection
objectIterator, toArray
-
-
-
-
Method Detail
-
iterator
ObjectIterator<K> iterator()
Returns a type-specific iterator on the elements of this set.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 extendsSet
.- Specified by:
iterator
in interfaceCollection<K>
- Specified by:
iterator
in interfaceIterable<K>
- Specified by:
iterator
in interfaceObjectCollection<K>
- Specified by:
iterator
in interfaceObjectIterable<K>
- Specified by:
iterator
in interfaceSet<K>
- Returns:
- a type-specific iterator on the elements of this set.
-
remove
boolean remove(Object k)
Removes an element from this set.Note that the corresponding method of the type-specific collection is
rem()
. This unfortunate situation is caused by the clash with the similarly named index-based method in theList
interface.- Specified by:
remove
in interfaceCollection<K>
- Specified by:
remove
in interfaceSet<K>
- See Also:
Collection.remove(Object)
-
-