![JAR search and dependency download from the Maven repository](/logo.png)
org.jhotdraw8.icollection.immutable.ImmutableAddOnlySet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.jhotdraw8.icollection Show documentation
Show all versions of org.jhotdraw8.icollection Show documentation
JHotDraw8 Immutable Collections
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