All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jhotdraw8.icollection.immutable.ImmutableAddOnlySet Maven / Gradle / Ivy

The newest version!
/*
 * @(#)ImmutableAddOnlySet.java
 * Copyright © 2023 The authors and contributors of JHotDraw. MIT License.
 */

package org.jhotdraw8.icollection.immutable;


/**
 * An interface to an immutable set that only provides an
 * {@link #add add} method; the implementation guarantees that the state of the collection does not change.
 *
 * @param  the element type
 */
public interface ImmutableAddOnlySet {
    /**
     * Returns a copy of this set that contains all elements
     * of this set and also the specified element.
     *
     * @param element an element
     * @return this set if it already contains the element, or
     * a different set with the element added
     */
    ImmutableAddOnlySet add(E element);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy