
org.eclipse.collections.api.bag.MutableBagIterable Maven / Gradle / Ivy
/*
* 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 super T> procedure);
MutableBagIterable select(Predicate super T> predicate);
MutableBagIterable selectWith(Predicate2 super T, ? super P> predicate, P parameter);
MutableBagIterable reject(Predicate super T> predicate);
MutableBagIterable rejectWith(Predicate2 super T, ? super P> predicate, P parameter);
PartitionMutableBagIterable partition(Predicate super T> predicate);
PartitionMutableBagIterable partitionWith(Predicate2 super T, ? super P> predicate, P parameter);
MutableBagIterable selectInstancesOf(Class clazz);
MutableBagIterableMultimap groupBy(Function super T, ? extends V> function);
MutableBagIterableMultimap groupByEach(Function super T, ? extends Iterable> 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 extends T> elements);
MutableBagIterable withoutAll(Iterable extends T> elements);
}