// 
// Decompiled by Procyon v0.6.0
// 

package it.unimi.dsi.fastutil.shorts;

import java.util.Iterator;
import java.util.Spliterator;
import java.util.Collection;
import it.unimi.dsi.fastutil.Size64;
import java.util.Set;

public interface ShortSet extends ShortCollection, Set<Short>
{
    ShortIterator iterator();
    
    default ShortSpliterator spliterator() {
        return ShortSpliterators.asSpliterator(this.iterator(), Size64.sizeOf(this), 321);
    }
    
    boolean remove(final short p0);
    
    @Deprecated
    default boolean remove(final Object o) {
        return super.remove(o);
    }
    
    @Deprecated
    default boolean add(final Short o) {
        return super.add(o);
    }
    
    @Deprecated
    default boolean contains(final Object o) {
        return super.contains(o);
    }
    
    @Deprecated
    default boolean rem(final short k) {
        return this.remove(k);
    }
    
    default ShortSet of() {
        return ShortSets.UNMODIFIABLE_EMPTY_SET;
    }
    
    default ShortSet of(final short e) {
        return ShortSets.singleton(e);
    }
    
    default ShortSet of(final short e0, final short e1) {
        final ShortArraySet innerSet = new ShortArraySet(2);
        innerSet.add(e0);
        if (!innerSet.add(e1)) {
            throw new IllegalArgumentException("Duplicate element: " + e1);
        }
        return ShortSets.unmodifiable(innerSet);
    }
    
    default ShortSet of(final short e0, final short e1, final short e2) {
        final ShortArraySet innerSet = new ShortArraySet(3);
        innerSet.add(e0);
        if (!innerSet.add(e1)) {
            throw new IllegalArgumentException("Duplicate element: " + e1);
        }
        if (!innerSet.add(e2)) {
            throw new IllegalArgumentException("Duplicate element: " + e2);
        }
        return ShortSets.unmodifiable(innerSet);
    }
    
    default ShortSet of(final short... a) {
        switch (a.length) {
            case 0: {
                return of();
            }
            case 1: {
                return of(a[0]);
            }
            case 2: {
                return of(a[0], a[1]);
            }
            case 3: {
                return of(a[0], a[1], a[2]);
            }
            default: {
                final ShortSet innerSet = (ShortSet)((a.length <= 4) ? new ShortArraySet(a.length) : new ShortOpenHashSet(a.length));
                for (final short element : a) {
                    if (!innerSet.add(element)) {
                        throw new IllegalArgumentException("Duplicate element: " + element);
                    }
                }
                return ShortSets.unmodifiable(innerSet);
            }
        }
    }
}
