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

com.gs.collections.api.map.OrderedMap Maven / Gradle / Ivy

/*
 * Copyright 2015 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.map;

import com.gs.collections.api.block.function.Function;
import com.gs.collections.api.block.function.Function0;
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.block.procedure.Procedure2;
import com.gs.collections.api.list.ListIterable;
import com.gs.collections.api.list.primitive.BooleanList;
import com.gs.collections.api.list.primitive.ByteList;
import com.gs.collections.api.list.primitive.CharList;
import com.gs.collections.api.list.primitive.DoubleList;
import com.gs.collections.api.list.primitive.FloatList;
import com.gs.collections.api.list.primitive.IntList;
import com.gs.collections.api.list.primitive.LongList;
import com.gs.collections.api.list.primitive.ShortList;
import com.gs.collections.api.multimap.list.ListMultimap;
import com.gs.collections.api.ordered.ReversibleIterable;
import com.gs.collections.api.partition.list.PartitionList;
import com.gs.collections.api.tuple.Pair;

/**
 * A map whose keys are ordered but not necessarily sorted, for example a linked hash map.
 */
public interface OrderedMap
        extends MapIterable, ReversibleIterable
{
    OrderedMap tap(Procedure procedure);

    OrderedMap flipUniqueValues();

    ListMultimap flip();

    OrderedMap select(Predicate2 predicate);

    OrderedMap reject(Predicate2 predicate);

     OrderedMap collect(Function2> function);

     OrderedMap collectValues(Function2 function);

    ImmutableOrderedMap toImmutable();

    OrderedMap toReversed();

    OrderedMap take(int count);

    OrderedMap takeWhile(Predicate predicate);

    OrderedMap drop(int count);

    OrderedMap dropWhile(Predicate predicate);

    PartitionList partitionWhile(Predicate predicate);

    ListIterable distinct();

    ListIterable select(Predicate predicate);

    

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

ListIterable rejectWith(Predicate2 predicate, P parameter); PartitionList partition(Predicate predicate);

PartitionList partitionWith(Predicate2 predicate, P parameter); BooleanList collectBoolean(BooleanFunction booleanFunction); ByteList collectByte(ByteFunction byteFunction); CharList collectChar(CharFunction charFunction); DoubleList collectDouble(DoubleFunction doubleFunction); FloatList collectFloat(FloatFunction floatFunction); IntList collectInt(IntFunction intFunction); LongList collectLong(LongFunction longFunction); ShortList collectShort(ShortFunction shortFunction); ListIterable> zip(Iterable that); ListIterable> zipWithIndex(); ListIterable collectWith(Function2 function, P parameter); ListIterable collectIf(Predicate predicate, Function function); ListIterable selectInstancesOf(Class clazz); ListIterable flatCollect(Function> function); ListMultimap groupBy(Function function); ListMultimap groupByEach(Function> function); OrderedMap groupByUniqueKey(Function function); OrderedMap aggregateInPlaceBy(Function groupBy, Function0 zeroValueFactory, Procedure2 mutatingAggregator); OrderedMap aggregateBy(Function groupBy, Function0 zeroValueFactory, Function2 nonMutatingAggregator); }