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

package it.unimi.dsi.fastutil.longs;

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

public interface LongSet extends LongCollection, Set<Long>
{
    LongIterator iterator();
    
    default LongSpliterator spliterator() {
        return LongSpliterators.asSpliterator(this.iterator(), Size64.sizeOf(this), 321);
    }
    
    boolean remove(final long p0);
    
    @Deprecated
    default boolean remove(final Object o) {
        return super.remove(o);
    }
    
    @Deprecated
    default boolean add(final Long o) {
        return super.add(o);
    }
    
    @Deprecated
    default boolean contains(final Object o) {
        return super.contains(o);
    }
    
    @Deprecated
    default boolean rem(final long k) {
        return this.remove(k);
    }
    
    default LongSet of() {
        return LongSets.UNMODIFIABLE_EMPTY_SET;
    }
    
    default LongSet of(final long e) {
        return LongSets.singleton(e);
    }
    
    default LongSet of(final long e0, final long e1) {
        final LongArraySet innerSet = new LongArraySet(2);
        innerSet.add(e0);
        if (!innerSet.add(e1)) {
            throw new IllegalArgumentException("Duplicate element: " + e1);
        }
        return LongSets.unmodifiable(innerSet);
    }
    
    default LongSet of(final long e0, final long e1, final long e2) {
        final LongArraySet innerSet = new LongArraySet(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 LongSets.unmodifiable(innerSet);
    }
    
    default LongSet of(final long... 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 LongSet innerSet = (LongSet)((a.length <= 4) ? new LongArraySet(a.length) : new LongOpenHashSet(a.length));
                for (final long element : a) {
                    if (!innerSet.add(element)) {
                        throw new IllegalArgumentException("Duplicate element: " + element);
                    }
                }
                return LongSets.unmodifiable(innerSet);
            }
        }
    }
}
