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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidChecks invariants of implementing class.booleanDetermines 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 SetintAdds 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.booleanisEmpty()iterator()Overridden here to require implementations to return a SplitableIterator rather than a basic Iterator.intsize()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, unionMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.javimmutable.collections.ICollection
isNonEmptyMethods inherited from interface org.javimmutable.collections.ISet
find, get, getValueOr, reject, select, setCollectorMethods inherited from interface org.javimmutable.collections.IStreamable
parallelStream, spliterator, streamMethods 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:AbstractSetImplemented by derived classes to create a new empty Set- Specified by:
emptyMutableSetin classAbstractSet<T>
-
insert
Description copied from interface:ISetAdds the single value to the Set. -
contains
Description copied from interface:ISetDetermines if the Set contains the specified value. -
delete
Description copied from interface:ISetRemoves the value from the Set. Has no effect if the value is not in the Set. -
deleteAll
Description copied from interface:ISetRemoves all values of other from the Set. Has no effect if none of the values are in the Set -
deleteAll
Description copied from interface:ISetRemoves all values of other from the Set. Has no effect if none of the values are in the Set -
union
Description copied from interface:ISetAdds all values from other to the Set. -
intersection
Description copied from interface:ISetRemoves all values from the Set that are not contained in the other collection.- Specified by:
intersectionin interfaceISet<T>- Overrides:
intersectionin classAbstractSet<T>- Returns:
- instance of set with unmatched values removed
-
intersection
Description copied from interface:ISetRemoves all values from the Set that are not contained in the other collection.- Specified by:
intersectionin interfaceISet<T>- Overrides:
intersectionin classAbstractSet<T>- Returns:
- instance of set with unmatched values removed
-
intersection
Description copied from interface:ISetRemoves all values from the Set that are not contained in the other collection.- Specified by:
intersectionin interfaceISet<T>- Returns:
- instance of set with unmatched values removed
-
intersection
Description copied from interface:ISetRemoves all values from the Set that are not contained in the other collection.- Specified by:
intersectionin interfaceISet<T>- Returns:
- instance of set with unmatched values removed
-
size
public int size()- Specified by:
sizein interfaceICollection<T>- Returns:
- number of values in the collection
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceICollection<T>- Returns:
- true only if collection contains no values
-
deleteAll
-
checkInvariants
public void checkInvariants()Description copied from interface:InvariantCheckableChecks invariants of implementing class.- Specified by:
checkInvariantsin interfaceInvariantCheckable
-
iterator
Description copied from interface:IStreamableOverridden 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:
iteratorin interfaceIStreamable<T>- Specified by:
iteratorin interfaceIterable<T>- Specified by:
iteratorin interfaceSplitableIterable<T>
-
getSpliteratorCharacteristics
public int getSpliteratorCharacteristics()- Specified by:
getSpliteratorCharacteristicsin interfaceIStreamable<T>- Returns:
- characteristics value used when creating Spliterators
-