Class EmptyHashSet<T>
java.lang.Object
org.javimmutable.collections.common.AbstractSet<T>
org.javimmutable.collections.hash.EmptyHashSet<T>
- All Implemented Interfaces:
Serializable
,Iterable<T>
,ICollection<T>
,InvariantCheckable
,ISet<T>
,IStreamable<T>
,Mapped<T,
,T> SplitableIterable<T>
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks invariants of implementing class.boolean
Determines if the Set contains the specified value.Removes the value from the Set.Removes all values of other from the Set.Removes all values of other from the Set.Implemented by derived classes to create a new empty Setint
Adds the single value to the Set.static <T> EmptyHashSet
<T> instance()
intersection
(Iterable<? extends T> other) Removes all values from the Set that are not contained in the other collection.intersection
(Iterator<? extends T> values) Removes all values from the Set that are not contained in the other collection.intersection
(Set<? extends T> other) Removes all values from the Set that are not contained in the other collection.intersection
(ISet<? extends T> other) Removes all values from the Set that are not contained in the other collection.boolean
isEmpty()
iterator()
Overridden here to require implementations to return a SplitableIterator rather than a basic Iterator.int
size()
Adds all values from other to the Set.Methods inherited from class org.javimmutable.collections.common.AbstractSet
containsAll, containsAll, containsAny, containsAny, equals, getSet, hashCode, insertAll, insertAll, toString, union
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.javimmutable.collections.ICollection
isNonEmpty
Methods inherited from interface org.javimmutable.collections.ISet
find, get, getValueOr, reject, select, setCollector
Methods inherited from interface org.javimmutable.collections.IStreamable
parallelStream, spliterator, stream
Methods inherited from interface org.javimmutable.collections.SplitableIterable
forEachThrows, indexedForEach, indexedForEachThrows, reduce, reduceThrows
-
Constructor Details
-
EmptyHashSet
public EmptyHashSet()
-
-
Method Details
-
instance
-
emptyMutableSet
Description copied from class:AbstractSet
Implemented by derived classes to create a new empty Set- Specified by:
emptyMutableSet
in classAbstractSet<T>
-
insert
Description copied from interface:ISet
Adds the single value to the Set. -
contains
Description copied from interface:ISet
Determines if the Set contains the specified value. -
delete
Description copied from interface:ISet
Removes the value from the Set. Has no effect if the value is not in the Set. -
deleteAll
Description copied from interface:ISet
Removes all values of other from the Set. Has no effect if none of the values are in the Set -
deleteAll
Description copied from interface:ISet
Removes all values of other from the Set. Has no effect if none of the values are in the Set -
union
Description copied from interface:ISet
Adds all values from other to the Set. -
intersection
Description copied from interface:ISet
Removes all values from the Set that are not contained in the other collection.- Specified by:
intersection
in interfaceISet<T>
- Overrides:
intersection
in classAbstractSet<T>
- Returns:
- instance of set with unmatched values removed
-
intersection
Description copied from interface:ISet
Removes all values from the Set that are not contained in the other collection.- Specified by:
intersection
in interfaceISet<T>
- Overrides:
intersection
in classAbstractSet<T>
- Returns:
- instance of set with unmatched values removed
-
intersection
Description copied from interface:ISet
Removes all values from the Set that are not contained in the other collection.- Specified by:
intersection
in interfaceISet<T>
- Returns:
- instance of set with unmatched values removed
-
intersection
Description copied from interface:ISet
Removes all values from the Set that are not contained in the other collection.- Specified by:
intersection
in interfaceISet<T>
- Returns:
- instance of set with unmatched values removed
-
size
public int size()- Specified by:
size
in interfaceICollection<T>
- Returns:
- number of values in the collection
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceICollection<T>
- Returns:
- true only if collection contains no values
-
deleteAll
-
checkInvariants
public void checkInvariants()Description copied from interface:InvariantCheckable
Checks invariants of implementing class.- Specified by:
checkInvariants
in interfaceInvariantCheckable
-
iterator
Description copied from interface:IStreamable
Overridden here to require implementations to return a SplitableIterator rather than a basic Iterator. This is necessary to allow composition of new objects from methods like keys() and values().- Specified by:
iterator
in interfaceIStreamable<T>
- Specified by:
iterator
in interfaceIterable<T>
- Specified by:
iterator
in interfaceSplitableIterable<T>
-
getSpliteratorCharacteristics
public int getSpliteratorCharacteristics()- Specified by:
getSpliteratorCharacteristics
in interfaceIStreamable<T>
- Returns:
- characteristics value used when creating Spliterators
-