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 protectedAbstractObjectSet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()Returns a hash code for this set.abstract ObjectIterator<K>iterator()Returns a type-specific iterator on the elements of this collection.booleanremove(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:ObjectCollectionReturns 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:
iteratorin interfaceCollection<K>- Specified by:
iteratorin interfaceIterable<K>- Specified by:
iteratorin interfaceObjectCollection<K>- Specified by:
iteratorin interfaceObjectIterable<K>- Specified by:
iteratorin interfaceObjectSet<K>- Specified by:
iteratorin interfaceSet<K>- Specified by:
iteratorin 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:ObjectSetRemoves 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 theListinterface.- Specified by:
removein interfaceCollection<K>- Specified by:
removein interfaceObjectSet<K>- Specified by:
removein interfaceSet<K>- Overrides:
removein classAbstractCollection<K>- See Also:
Collection.remove(Object)
-
-