org.jhotdraw8.icollection.readonly.ReadOnlySequencedSet Maven / Gradle / Ivy
/*
* @(#)ReadOnlySequencedSet.java
* Copyright © 2023 The authors and contributors of JHotDraw. MIT License.
*/
package org.jhotdraw8.icollection.readonly;
import org.jhotdraw8.icollection.facade.SequencedSetFacade;
import java.util.SequencedSet;
/**
* A read-only interface to a sequenced set. A sequenced set is a collection that is both a
* sequenced collection and a set.
*
* References:
*
* - JEP draft: Sequenced Collections
* - java.ne
*
*
* @param the element type
*/
public interface ReadOnlySequencedSet extends ReadOnlySet, ReadOnlySequencedCollection {
/**
* Returns a reversed-order view of this set.
* Changes to the underlying set are visible in the reversed view.
*
* @return a reversed-order view of this set
*/
ReadOnlySequencedSet readOnlyReversed();
@Override
default SequencedSet asSet() {
return new SequencedSetFacade<>(this);
}
}