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

co.streamx.fluent.JPA.util.ScopedArrayList Maven / Gradle / Ivy

The newest version!
package co.streamx.fluent.JPA.util;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import lombok.RequiredArgsConstructor;

@SuppressWarnings("serial")
@RequiredArgsConstructor
public class ScopedArrayList extends ArrayList {
    private final List upper;

    protected List getUpper() {
        return this.upper;
    }

    @Override
    public int size() {
        return super.size() + upper.size();
    }

    @Override
    public boolean isEmpty() {
        return super.isEmpty() && upper.isEmpty();
    }

    @Override
    public boolean contains(Object o) {
        return super.contains(o) || upper.contains(o);
    }

    @Override
    public boolean remove(Object o) {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean containsAll(Collection c) {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean addAll(Collection c) {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean addAll(int index,
                          Collection c) {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean removeAll(Collection c) {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean retainAll(Collection c) {
        throw new UnsupportedOperationException();
    }

    @Override
    public void clear() {
        throw new UnsupportedOperationException();
    }

    @Override
    public E get(int index) {
        throw new UnsupportedOperationException();
    }

    @Override
    public E set(int index,
                 E element) {
        throw new UnsupportedOperationException();
    }

    @Override
    public void add(int index,
                    E element) {
        throw new UnsupportedOperationException();
    }

    @Override
    public E remove(int index) {
        throw new UnsupportedOperationException();
    }

    @Override
    public int indexOf(Object o) {
        throw new UnsupportedOperationException();
    }

    @Override
    public int lastIndexOf(Object o) {
        throw new UnsupportedOperationException();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy