org.jhotdraw8.icollection.facade.SetFacade Maven / Gradle / Ivy
/*
* @(#)SetFacade.java
* Copyright © 2023 The authors and contributors of JHotDraw. MIT License.
*/
package org.jhotdraw8.icollection.facade;
import org.jhotdraw8.icollection.readonly.ReadOnlySet;
import org.jspecify.annotations.Nullable;
import java.util.AbstractSet;
import java.util.Iterator;
import java.util.Set;
import java.util.Spliterator;
import java.util.Spliterators;
import java.util.function.IntSupplier;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Stream;
/**
* Provides a {@link Set} facade to a set of {@code Set} functions.
*
* @param the element type
* @author Werner Randelshofer
*/
public class SetFacade extends AbstractSet implements ReadOnlySet {
protected final Supplier> iteratorFunction;
protected final Supplier> spliteratorFunction;
protected final IntSupplier sizeFunction;
protected final Predicate