Module org.jhotdraw8.icollection
Package org.jhotdraw8.icollection.facade
Class ReadOnlyCollectionFacade<E>
java.lang.Object
org.jhotdraw8.icollection.readonly.AbstractReadOnlyCollection<E>
org.jhotdraw8.icollection.facade.ReadOnlyCollectionFacade<E>
- Type Parameters:
E- the element type
- All Implemented Interfaces:
Iterable<E>,ReadOnlyCollection<E>
- Direct Known Subclasses:
ReadOnlySequencedCollectionFacade
Provides a
ReadOnlyCollection facade to a set of Collection functions.- Author:
- Werner Randelshofer
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReadOnlyCollectionFacade(@NonNull Supplier<Iterator<E>> iteratorFunction, @Nullable IntSupplier sizeFunction, @NonNull Predicate<Object> containsFunction, int characteristics) -
Method Summary
Methods 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, characteristics, containsAll, isEmpty, stream, toArray, toArray
-
Field Details
-
iteratorFunction
-
sizeFunction
-
containsFunction
-
characteristics
protected final int characteristics
-
-
Constructor Details
-
ReadOnlyCollectionFacade
-
ReadOnlyCollectionFacade
-
-
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
-
equals
-
hashCode
public int hashCode()
-