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

com.gs.collections.api.stack.ImmutableStack Maven / Gradle / Ivy

/*
 * 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.api.stack;

import com.gs.collections.api.block.function.Function;
import com.gs.collections.api.block.function.Function2;
import com.gs.collections.api.block.function.primitive.BooleanFunction;
import com.gs.collections.api.block.function.primitive.ByteFunction;
import com.gs.collections.api.block.function.primitive.CharFunction;
import com.gs.collections.api.block.function.primitive.DoubleFunction;
import com.gs.collections.api.block.function.primitive.FloatFunction;
import com.gs.collections.api.block.function.primitive.IntFunction;
import com.gs.collections.api.block.function.primitive.LongFunction;
import com.gs.collections.api.block.function.primitive.ShortFunction;
import com.gs.collections.api.block.predicate.Predicate;
import com.gs.collections.api.block.predicate.Predicate2;
import com.gs.collections.api.block.procedure.Procedure;
import com.gs.collections.api.map.ImmutableMap;
import com.gs.collections.api.multimap.list.ImmutableListMultimap;
import com.gs.collections.api.partition.stack.PartitionImmutableStack;
import com.gs.collections.api.stack.primitive.ImmutableBooleanStack;
import com.gs.collections.api.stack.primitive.ImmutableByteStack;
import com.gs.collections.api.stack.primitive.ImmutableCharStack;
import com.gs.collections.api.stack.primitive.ImmutableDoubleStack;
import com.gs.collections.api.stack.primitive.ImmutableFloatStack;
import com.gs.collections.api.stack.primitive.ImmutableIntStack;
import com.gs.collections.api.stack.primitive.ImmutableLongStack;
import com.gs.collections.api.stack.primitive.ImmutableShortStack;
import com.gs.collections.api.tuple.Pair;

public interface ImmutableStack extends StackIterable
{
    ImmutableStack push(T item);

    ImmutableStack pop();

    ImmutableStack pop(int count);

    ImmutableStack tap(Procedure procedure);

    ImmutableStack select(Predicate predicate);

    

ImmutableStack selectWith(Predicate2 predicate, P parameter); ImmutableStack reject(Predicate predicate);

ImmutableStack rejectWith(Predicate2 predicate, P parameter); PartitionImmutableStack partition(Predicate predicate);

PartitionImmutableStack partitionWith(Predicate2 predicate, P parameter); ImmutableStack collect(Function function); ImmutableBooleanStack collectBoolean(BooleanFunction booleanFunction); ImmutableByteStack collectByte(ByteFunction byteFunction); ImmutableCharStack collectChar(CharFunction charFunction); ImmutableDoubleStack collectDouble(DoubleFunction doubleFunction); ImmutableFloatStack collectFloat(FloatFunction floatFunction); ImmutableIntStack collectInt(IntFunction intFunction); ImmutableLongStack collectLong(LongFunction longFunction); ImmutableShortStack collectShort(ShortFunction shortFunction); ImmutableStack collectWith(Function2 function, P parameter); ImmutableStack collectIf(Predicate predicate, Function function); ImmutableStack flatCollect(Function> function); ImmutableListMultimap groupBy(Function function); ImmutableListMultimap groupByEach(Function> function); ImmutableMap groupByUniqueKey(Function function); ImmutableStack> zip(Iterable that); ImmutableStack> zipWithIndex(); /** * Size takes linear time on ImmutableStacks. */ int size(); }