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

org.eclipse.collections.api.bag.MutableBagIterable 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.bag;

import org.eclipse.collections.api.block.function.Function;
import org.eclipse.collections.api.block.predicate.Predicate;
import org.eclipse.collections.api.block.predicate.Predicate2;
import org.eclipse.collections.api.block.predicate.primitive.IntPredicate;
import org.eclipse.collections.api.block.procedure.Procedure;
import org.eclipse.collections.api.collection.MutableCollection;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.api.map.MutableMapIterable;
import org.eclipse.collections.api.multimap.bag.MutableBagIterableMultimap;
import org.eclipse.collections.api.partition.bag.PartitionMutableBagIterable;
import org.eclipse.collections.api.set.MutableSetIterable;
import org.eclipse.collections.api.tuple.Pair;
import org.eclipse.collections.api.tuple.primitive.ObjectIntPair;

public interface MutableBagIterable extends Bag, MutableCollection
{
    void addOccurrences(T item, int occurrences);

    boolean removeOccurrences(Object item, int occurrences);

    boolean setOccurrences(T item, int occurrences);

    MutableBagIterable tap(Procedure procedure);

    MutableBagIterable select(Predicate predicate);

    

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

MutableBagIterable rejectWith(Predicate2 predicate, P parameter); PartitionMutableBagIterable partition(Predicate predicate);

PartitionMutableBagIterable partitionWith(Predicate2 predicate, P parameter); MutableBagIterable selectInstancesOf(Class clazz); MutableBagIterableMultimap groupBy(Function function); MutableBagIterableMultimap groupByEach(Function> function); MutableSetIterable> zipWithIndex(); MutableBagIterable selectByOccurrences(IntPredicate predicate); MutableMapIterable toMapOfItemToCount(); /** * @since 6.0 */ MutableList> topOccurrences(int count); /** * @since 6.0 */ MutableList> bottomOccurrences(int count); MutableBagIterable with(T element); MutableBagIterable without(T element); MutableBagIterable withAll(Iterable elements); MutableBagIterable withoutAll(Iterable elements); }