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

org.eclipse.collections.api.stack.ImmutableStack Maven / Gradle / Ivy

There is a newer version: 12.0.0.M3
Show newest version
/*
 * Copyright (c) 2015 Goldman Sachs.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * and Eclipse Distribution License v. 1.0 which accompany this distribution.
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
 * and the Eclipse Distribution License is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 */

package org.eclipse.collections.api.stack;

import org.eclipse.collections.api.block.function.Function;
import org.eclipse.collections.api.block.function.Function2;
import org.eclipse.collections.api.block.function.primitive.BooleanFunction;
import org.eclipse.collections.api.block.function.primitive.ByteFunction;
import org.eclipse.collections.api.block.function.primitive.CharFunction;
import org.eclipse.collections.api.block.function.primitive.DoubleFunction;
import org.eclipse.collections.api.block.function.primitive.FloatFunction;
import org.eclipse.collections.api.block.function.primitive.IntFunction;
import org.eclipse.collections.api.block.function.primitive.LongFunction;
import org.eclipse.collections.api.block.function.primitive.ShortFunction;
import org.eclipse.collections.api.block.predicate.Predicate;
import org.eclipse.collections.api.block.predicate.Predicate2;
import org.eclipse.collections.api.block.procedure.Procedure;
import org.eclipse.collections.api.map.ImmutableMap;
import org.eclipse.collections.api.multimap.list.ImmutableListMultimap;
import org.eclipse.collections.api.partition.stack.PartitionImmutableStack;
import org.eclipse.collections.api.stack.primitive.ImmutableBooleanStack;
import org.eclipse.collections.api.stack.primitive.ImmutableByteStack;
import org.eclipse.collections.api.stack.primitive.ImmutableCharStack;
import org.eclipse.collections.api.stack.primitive.ImmutableDoubleStack;
import org.eclipse.collections.api.stack.primitive.ImmutableFloatStack;
import org.eclipse.collections.api.stack.primitive.ImmutableIntStack;
import org.eclipse.collections.api.stack.primitive.ImmutableLongStack;
import org.eclipse.collections.api.stack.primitive.ImmutableShortStack;
import org.eclipse.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(); }