Module org.jhotdraw8.icollection
Package org.jhotdraw8.icollection.facade
Class ReadOnlySetFacade<E>
java.lang.Object
org.jhotdraw8.icollection.readonly.AbstractReadOnlyCollection<E>
org.jhotdraw8.icollection.readonly.AbstractReadOnlySet<E>
org.jhotdraw8.icollection.facade.ReadOnlySetFacade<E>
- Type Parameters:
E- the element type
- All Implemented Interfaces:
Iterable<E>,ReadOnlyCollection<E>,ReadOnlySet<E>
- Direct Known Subclasses:
ReadOnlyNavigableSetFacade,ReadOnlySequencedSetFacade,ReadOnlySortedSetFacade
Provides a
ReadOnlySet facade to a set of Set functions.- Author:
- Werner Randelshofer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intCharacteristics of the spliterator.protected final IntSupplier -
Constructor Summary
ConstructorsConstructorDescriptionReadOnlySetFacade(Collection<E> backingSet) ReadOnlySetFacade(Supplier<Iterator<E>> iteratorFunction, IntSupplier sizeFunction, Predicate<Object> containsFunction, int characteristics) ReadOnlySetFacade(ReadOnlyCollection<E> backingSet) -
Method Summary
Methods inherited from class org.jhotdraw8.icollection.readonly.AbstractReadOnlySet
equalsMethods inherited from class org.jhotdraw8.icollection.readonly.AbstractReadOnlyCollection
toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlyCollection
asCollection, containsAll, isEmpty, stream, toArray, toArrayMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlySet
asSet, characteristics
-
Field Details
-
iteratorFunction
-
sizeFunction
-
containsFunction
-
characteristics
protected final int characteristicsCharacteristics of the spliterator.
-
-
Constructor Details
-
ReadOnlySetFacade
-
ReadOnlySetFacade
-
ReadOnlySetFacade
-
-
Method Details
-
size
public int size()Description copied from interface:ReadOnlyCollectionReturns the size of the collection.- Returns:
- the size
-
contains
Description copied from interface:ReadOnlyCollectionReturnstrueif this collection contains the specified object.- Specified by:
containsin interfaceReadOnlyCollection<E>- Overrides:
containsin classAbstractReadOnlyCollection<E>- Parameters:
o- an object- Returns:
trueif this collection contains the specified object
-
iterator
Description copied from interface:ReadOnlyCollectionReturns an iterator over the elements in this collection.- Returns:
- an iterator
-
spliterator
-
hashCode
public int hashCode()Description copied from interface:ReadOnlySetReturns the hash code value for this set. The hash code is the sum of the hash code of its elements.Implementations of this method should use
ReadOnlySet.iteratorToHashCode(java.util.Iterator<E>).- Specified by:
hashCodein interfaceReadOnlySet<E>- Overrides:
hashCodein classAbstractReadOnlySet<E>- Returns:
- the hash code value for this set
- See Also:
-