Package com.gs.collections.impl.stack.mutable.primitive

Source Code of com.gs.collections.impl.stack.mutable.primitive.UnmodifiableBooleanStack

/*
* Copyright 2014 Goldman Sachs.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.gs.collections.impl.stack.mutable.primitive;

import java.io.Serializable;

import com.gs.collections.api.BooleanIterable;
import com.gs.collections.api.LazyBooleanIterable;
import com.gs.collections.api.bag.primitive.MutableBooleanBag;
import com.gs.collections.api.block.function.primitive.BooleanToObjectFunction;
import com.gs.collections.api.block.function.primitive.ObjectBooleanToObjectFunction;
import com.gs.collections.api.block.predicate.primitive.BooleanPredicate;
import com.gs.collections.api.block.procedure.primitive.BooleanProcedure;
import com.gs.collections.api.iterator.BooleanIterator;
import com.gs.collections.api.list.primitive.BooleanList;
import com.gs.collections.api.list.primitive.MutableBooleanList;
import com.gs.collections.api.set.primitive.MutableBooleanSet;
import com.gs.collections.api.stack.MutableStack;
import com.gs.collections.api.stack.primitive.ImmutableBooleanStack;
import com.gs.collections.api.stack.primitive.MutableBooleanStack;
import com.gs.collections.impl.factory.primitive.BooleanStacks;
import com.gs.collections.impl.lazy.primitive.LazyBooleanIterableAdapter;
import net.jcip.annotations.NotThreadSafe;

/**
* This file was automatically generated from template file unmodifiablePrimitiveStack.stg.
*
* @since 3.1.
*/
@NotThreadSafe
public final class UnmodifiableBooleanStack
        implements MutableBooleanStack, Serializable
{
    private static final long serialVersionUID = 1L;

    private final MutableBooleanStack stack;

    UnmodifiableBooleanStack(MutableBooleanStack stack)
    {
        this.stack = stack;
    }

    public void push(boolean item)
    {
        throw new UnsupportedOperationException("Cannot call push() on " + this.getClass().getSimpleName());
    }

    public boolean pop()
    {
        throw new UnsupportedOperationException("Cannot call pop() on " + this.getClass().getSimpleName());
    }

    public BooleanList pop(int count)
    {
        throw new UnsupportedOperationException("Cannot call pop() on " + this.getClass().getSimpleName());
    }

    public boolean peek()
    {
        return this.stack.peek();
    }

    public BooleanList peek(int count)
    {
        return this.stack.peek(count);
    }

    public boolean peekAt(int index)
    {
        return this.stack.peekAt(index);
    }

    public int size()
    {
        return this.stack.size();
    }

    public boolean isEmpty()
    {
        return this.stack.isEmpty();
    }

    public boolean notEmpty()
    {
        return this.stack.notEmpty();
    }

    public void clear()
    {
        throw new UnsupportedOperationException("Cannot call clear() on " + this.getClass().getSimpleName());
    }

    public boolean contains(boolean value)
    {
        return this.stack.contains(value);
    }

    public boolean containsAll(boolean... source)
    {
        return this.stack.containsAll(source);
    }

    public boolean containsAll(BooleanIterable source)
    {
        return this.stack.containsAll(source);
    }

    public BooleanIterator booleanIterator()
    {
        return this.stack.booleanIterator();
    }

    public void forEach(BooleanProcedure procedure)
    {
        this.stack.forEach(procedure);
    }

    public int count(BooleanPredicate predicate)
    {
        return this.stack.count(predicate);
    }

    public boolean anySatisfy(BooleanPredicate predicate)
    {
        return this.stack.anySatisfy(predicate);
    }

    public boolean allSatisfy(BooleanPredicate predicate)
    {
        return this.stack.allSatisfy(predicate);
    }

    public boolean noneSatisfy(BooleanPredicate predicate)
    {
        return this.stack.noneSatisfy(predicate);
    }

    public boolean detectIfNone(BooleanPredicate predicate, boolean ifNone)
    {
        return this.stack.detectIfNone(predicate, ifNone);
    }

    public MutableBooleanStack select(BooleanPredicate predicate)
    {
        return this.stack.select(predicate);
    }

    public MutableBooleanStack reject(BooleanPredicate predicate)
    {
        return this.stack.reject(predicate);
    }

    public <V> MutableStack<V> collect(BooleanToObjectFunction<? extends V> function)
    {
        return this.stack.collect(function);
    }

    public boolean[] toArray()
    {
        return this.stack.toArray();
    }

    @Override
    public String toString()
    {
        return this.stack.toString();
    }

    public String makeString()
    {
        return this.stack.makeString();
    }

    public String makeString(String separator)
    {
        return this.stack.makeString(separator);
    }

    public String makeString(String start, String separator, String end)
    {
        return this.stack.makeString(start, separator, end);
    }

    public void appendString(Appendable appendable)
    {
        this.stack.appendString(appendable);
    }

    public void appendString(Appendable appendable, String separator)
    {
        this.stack.appendString(appendable, separator);
    }

    public void appendString(
            Appendable appendable,
            String start,
            String separator,
            String end)
    {
        this.stack.appendString(appendable, start, separator, end);
    }

    public MutableBooleanList toList()
    {
        return this.stack.toList();
    }

    public MutableBooleanSet toSet()
    {
        return this.stack.toSet();
    }

    public MutableBooleanBag toBag()
    {
        return this.stack.toBag();
    }

    @Override
    public boolean equals(Object otherStack)
    {
        return this.stack.equals(otherStack);
    }

    @Override
    public int hashCode()
    {
        return this.stack.hashCode();
    }

    public LazyBooleanIterable asLazy()
    {
        return new LazyBooleanIterableAdapter(this);
    }

    public MutableBooleanStack asUnmodifiable()
    {
        return this;
    }

    public MutableBooleanStack asSynchronized()
    {
        return new SynchronizedBooleanStack(this);
    }

    public ImmutableBooleanStack toImmutable()
    {
        return BooleanStacks.immutable.withAllReversed(this);
    }

    public <T> T injectInto(T injectedValue, ObjectBooleanToObjectFunction<? super T, ? extends T> function)
    {
        return this.stack.injectInto(injectedValue, function);
    }
}
TOP

Related Classes of com.gs.collections.impl.stack.mutable.primitive.UnmodifiableBooleanStack

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.