Package it.unimi.dsi.fastutil.chars
Class AbstractCharSet
java.lang.Object
java.util.AbstractCollection<java.lang.Character>
it.unimi.dsi.fastutil.chars.AbstractCharCollection
it.unimi.dsi.fastutil.chars.AbstractCharSet
- All Implemented Interfaces:
CharCollection,it.unimi.dsi.fastutil.chars.CharIterable,CharSet,java.lang.Cloneable,java.lang.Iterable<java.lang.Character>,java.util.Collection<java.lang.Character>,java.util.Set<java.lang.Character>
- Direct Known Subclasses:
AbstractCharSortedSet,CharArraySet,CharOpenCustomHashSet,CharOpenHashSet,CharSets.Singleton
public abstract class AbstractCharSet extends AbstractCharCollection implements java.lang.Cloneable, CharSet
An abstract class providing basic methods for sets implementing a type-specific interface.
Note that the type-specific Set interface adds a type-specific remove()
method, as it is no longer harmful for subclasses. Thus, concrete subclasses of this class
must implement remove() (the rem() implementation of this
class just delegates to remove()).
-
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object o)inthashCode()Returns a hash code for this set.abstract it.unimi.dsi.fastutil.chars.CharIteratoriterator()Returns a type-specific iterator on the elements of this collection.booleanrem(char k)Deprecated.booleanremove(char k)Removes an element from this set.Methods inherited from class it.unimi.dsi.fastutil.chars.AbstractCharCollection
add, add, addAll, addAll, contains, contains, containsAll, containsAll, remove, removeAll, removeAll, retainAll, retainAll, toArray, toCharArray, toCharArray, toStringMethods inherited from class java.util.AbstractCollection
clear, isEmpty, size, toArray, toArrayMethods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface it.unimi.dsi.fastutil.chars.CharCollection
add, addAll, contains, containsAll, intIterator, intParallelStream, intSpliterator, intStream, parallelStream, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toArray, toCharArray, toCharArrayMethods inherited from interface it.unimi.dsi.fastutil.chars.CharIterable
forEach, forEach, forEachMethods inherited from interface it.unimi.dsi.fastutil.chars.CharSet
add, contains, remove, spliteratorMethods inherited from interface java.util.Collection
toArrayMethods inherited from interface java.util.Set
addAll, clear, containsAll, isEmpty, removeAll, retainAll, size, toArray, toArray
-
Method Details
-
iterator
public abstract it.unimi.dsi.fastutil.chars.CharIterator iterator()Description copied from interface:CharCollectionReturns a type-specific iterator on the elements of this collection.- Specified by:
iteratorin interfaceCharCollection- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.chars.CharIterable- Specified by:
iteratorin interfaceCharSet- Specified by:
iteratorin interfacejava.util.Collection<java.lang.Character>- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.Character>- Specified by:
iteratorin interfacejava.util.Set<java.lang.Character>- Specified by:
iteratorin classAbstractCharCollection- Returns:
- a type-specific iterator on the elements of this collection.
-
equals
public boolean equals(java.lang.Object o)- Specified by:
equalsin interfacejava.util.Collection<java.lang.Character>- Specified by:
equalsin interfacejava.util.Set<java.lang.Character>- Overrides:
equalsin classjava.lang.Object
-
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.- Specified by:
hashCodein interfacejava.util.Collection<java.lang.Character>- Specified by:
hashCodein interfacejava.util.Set<java.lang.Character>- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hash code for this set.
-
remove
public boolean remove(char k)Removes an element from this set. Delegates to the type-specificrem()method implemented by type-specific abstractCollectionsuperclass. -
rem
@Deprecated public boolean rem(char k)Deprecated.Please useremove()instead.Removes a single instance of the specified element from this collection, if it is present (optional operation).Note that this method should be called
remove(), but the clash with the similarly named index-based method in theListinterface forces us to use a distinguished name. For simplicity, the set interfaces reinstatesremove(). Delegates to the type-specificremove()method specified in the type-specificSetinterface.- Specified by:
remin interfaceCharCollection- Specified by:
remin interfaceCharSet- Overrides:
remin classAbstractCharCollection- See Also:
Collection.remove(Object)
-
remove()instead.