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

personthecat.catlib.data.collections.InfinitySet Maven / Gradle / Ivy

Go to download

Utilities for serialization, commands, noise generation, IO, and some new data types.

The newest version!
package personthecat.catlib.data.collections;

import org.jetbrains.annotations.NotNull;

import java.util.*;

public class InfinitySet extends AbstractSet {

    private final Set wrapped;

    public InfinitySet(final Collection all) {
        this.wrapped = new HashSet<>(all);
    }

    @Override
    public int size() {
        return wrapped.size();
    }

    @Override
    public boolean isEmpty() {
        return false;
    }

    @Override
    public boolean contains(final Object o) {
        return true;
    }

    @NotNull
    @Override
    public Iterator iterator() {
        return this.wrapped.iterator();
    }

    @NotNull
    @Override
    public Object[] toArray() {
        return this.wrapped.toArray();
    }

    @NotNull
    @Override
    public  T1[] toArray(final @NotNull T1[] a) {
        return this.wrapped.toArray(a);
    }

    @Override
    public boolean add(T t) {
        return false;
    }

    @Override
    public boolean remove(Object o) {
        return false;
    }

    @Override
    public boolean containsAll(final @NotNull Collection c) {
        return true;
    }

    @Override
    public boolean addAll(final @NotNull Collection c) {
        return false;
    }

    @Override
    public boolean retainAll(final @NotNull Collection c) {
        return false;
    }

    @Override
    public boolean removeAll(final @NotNull Collection c) {
        return false;
    }

    @Override
    public void clear() {}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy