Class AbstractObjectSet<K>
- java.lang.Object
-
- java.util.AbstractCollection<K>
-
- org.codelibs.jhighlight.fastutil.objects.AbstractObjectCollection<K>
-
- org.codelibs.jhighlight.fastutil.objects.AbstractObjectSet<K>
-
- All Implemented Interfaces:
Cloneable
,Iterable<K>
,Collection<K>
,Set<K>
,ObjectCollection<K>
,ObjectIterable<K>
,ObjectSet<K>
public abstract class AbstractObjectSet<K> extends AbstractObjectCollection<K> implements Cloneable, ObjectSet<K>
An abstract class providing basic methods for sets implementing a type-specific interface.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractObjectSet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
Returns a hash code for this set.abstract ObjectIterator<K>
iterator()
Returns a type-specific iterator on the elements of this collection.boolean
remove(Object k)
Removes an element from this set.-
Methods inherited from class org.codelibs.jhighlight.fastutil.objects.AbstractObjectCollection
add, addAll, containsAll, isEmpty, objectIterator, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.util.AbstractCollection
clear, contains, size
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
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
public abstract ObjectIterator<K> iterator()
Description copied from interface:ObjectCollection
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 interfaceObjectCollection<K>
- Specified by:
iterator
in interfaceObjectIterable<K>
- Specified by:
iterator
in interfaceObjectSet<K>
- Specified by:
iterator
in interfaceSet<K>
- Specified by:
iterator
in classAbstractObjectCollection<K>
- Returns:
- a type-specific iterator on the elements of this collection.
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
Returns a hash code for this set. The hash code of a set is computed by summing the hash codes of its elements.
-
remove
public boolean remove(Object k)
Description copied from interface:ObjectSet
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 interfaceObjectSet<K>
- Specified by:
remove
in interfaceSet<K>
- Overrides:
remove
in classAbstractCollection<K>
- See Also:
Collection.remove(Object)
-
-