java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
org.jhotdraw8.icollection.facade.SetFacade<E>
- Type Parameters:
E- the element type
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Set<E>,ReadOnlyCollection<E>,ReadOnlySet<E>
- Direct Known Subclasses:
SequencedSetFacade
Provides a
Set facade to a set of Set functions.- Author:
- Werner Randelshofer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Runnableprotected final IntSupplierprotected final Supplier<Spliterator<E>> -
Constructor Summary
ConstructorsConstructorDescriptionSetFacade(Supplier<Iterator<E>> iteratorFunction, IntSupplier sizeFunction, Predicate<Object> containsFunction) SetFacade(Supplier<Iterator<E>> iteratorFunction, Supplier<Spliterator<E>> spliteratorFunction, IntSupplier sizeFunction, Predicate<Object> containsFunction, @Nullable Runnable clearFunction, @Nullable Predicate<E> addFunction, @Nullable Predicate<Object> removeFunction) SetFacade(ReadOnlySet<E> backingSet) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidclear()booleanReturnstrueif this collection contains the specified object.booleanCompares the specified object with this set for equality.iterator()Returns an iterator over the elements in this collection.booleanintsize()Returns the size of the collection.stream()Returns a stream.Methods inherited from class java.util.AbstractSet
hashCode, removeAllMethods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, toArrayMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlyCollection
asCollection, containsAll, isEmpty, toArray, toArrayMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlySet
asSet, characteristics, hashCode
-
Field Details
-
iteratorFunction
-
spliteratorFunction
-
sizeFunction
-
containsFunction
-
addFunction
-
clearFunction
-
removeFunction
-
-
Constructor Details
-
SetFacade
-
SetFacade
-
SetFacade
-
SetFacade
-
-
Method Details
-
remove
- Specified by:
removein interfaceCollection<E>- Specified by:
removein interfaceSet<E>- Overrides:
removein classAbstractCollection<E>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceSet<E>- Overrides:
clearin classAbstractCollection<E>
-
spliterator
- Specified by:
spliteratorin interfaceCollection<E>- Specified by:
spliteratorin interfaceIterable<E>- Specified by:
spliteratorin interfaceSet<E>
-
stream
Description copied from interface:ReadOnlyCollectionReturns a stream.- Specified by:
streamin interfaceCollection<E>- Specified by:
streamin interfaceReadOnlyCollection<E>- Returns:
- a stream
-
iterator
Description copied from interface:ReadOnlyCollectionReturns an iterator over the elements in this collection.- Specified by:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceIterable<E>- Specified by:
iteratorin interfaceReadOnlyCollection<E>- Specified by:
iteratorin interfaceSet<E>- Specified by:
iteratorin classAbstractCollection<E>- Returns:
- an iterator
-
equals
Description copied from interface:ReadOnlySetCompares the specified object with this set for equality.Returns
trueif the given object is also a read-only set and the two sets contain the same elements, ignoring the sequence of the elements.Implementations of this method should use
ReadOnlySet.setEquals(org.jhotdraw8.icollection.readonly.ReadOnlySet<E>, java.lang.Object).- Specified by:
equalsin interfaceCollection<E>- Specified by:
equalsin interfaceReadOnlySet<E>- Specified by:
equalsin interfaceSet<E>- Overrides:
equalsin classAbstractSet<E>- Parameters:
o- an object- Returns:
trueif the object is equal to this map
-
size
public int size()Description copied from interface:ReadOnlyCollectionReturns the size of the collection.- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceReadOnlyCollection<E>- Specified by:
sizein interfaceSet<E>- Specified by:
sizein classAbstractCollection<E>- Returns:
- the size
-
contains
Description copied from interface:ReadOnlyCollectionReturnstrueif this collection contains the specified object.- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceReadOnlyCollection<E>- Specified by:
containsin interfaceSet<E>- Overrides:
containsin classAbstractCollection<E>- Parameters:
o- an object- Returns:
trueif this collection contains the specified object
-
add
- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceSet<E>- Overrides:
addin classAbstractCollection<E>
-