public class TreeBag<T> extends AbstractMutableSortedBag<T> implements Externalizable
| Constructor and Description |
|---|
TreeBag() |
TreeBag(Comparator<? super T> comparator) |
TreeBag(Comparator<? super T> comparator,
Iterable<? extends T> iterable) |
TreeBag(SortedBag<T> sortedBag) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T item) |
int |
addOccurrences(T item,
int occurrences) |
boolean |
allSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate) |
boolean |
anySatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate) |
void |
clear() |
TreeBag<T> |
clone() |
Comparator<? super T> |
comparator() |
int |
compareTo(SortedBag<T> otherBag) |
boolean |
contains(Object o) |
<S> boolean |
corresponds(OrderedIterable<S> other,
Predicate2<? super T,? super S> predicate) |
int |
detectIndex(Predicate<? super T> predicate) |
T |
detectWithOccurrences(ObjectIntPredicate<? super T> predicate) |
MutableSortedSet<T> |
distinct() |
RichIterable<T> |
distinctView() |
MutableSortedBag<T> |
drop(int count) |
void |
each(Procedure<? super T> procedure) |
boolean |
equals(Object other) |
void |
forEach(int fromIndex,
int toIndex,
Procedure<? super T> procedure) |
<P> void |
forEachWith(Procedure2<? super T,? super P> procedure,
P parameter) |
void |
forEachWithIndex(int fromIndex,
int toIndex,
ObjectIntProcedure<? super T> objectIntProcedure) |
void |
forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure) |
void |
forEachWithOccurrences(ObjectIntProcedure<? super T> procedure) |
<V> TreeBagMultimap<V,T> |
groupBy(Function<? super T,? extends V> function) |
<V> TreeBagMultimap<V,T> |
groupByEach(Function<? super T,? extends Iterable<V>> function) |
int |
hashCode() |
int |
indexOf(Object object) |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
static <E> TreeBag<E> |
newBag() |
static <E> TreeBag<E> |
newBag(Comparator<? super E> comparator) |
static <E> TreeBag<E> |
newBag(Comparator<? super E> comparator,
Iterable<? extends E> iterable) |
static <E> TreeBag<E> |
newBag(Iterable<? extends E> source) |
static <E> TreeBag<E> |
newBagWith(Comparator<? super E> comparator,
E... elements) |
static <E> TreeBag<E> |
newBagWith(E... elements) |
MutableSortedBag<T> |
newEmpty() |
boolean |
noneSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate) |
int |
occurrencesOf(Object item) |
void |
readExternal(ObjectInput in) |
boolean |
remove(Object item) |
boolean |
removeAllIterable(Iterable<?> iterable) |
boolean |
removeIf(Predicate<? super T> predicate) |
<P> boolean |
removeIfWith(Predicate2<? super T,? super P> predicate,
P parameter) |
boolean |
removeOccurrences(Object item,
int occurrences) |
MutableSortedBag<T> |
selectByOccurrences(IntPredicate predicate) |
boolean |
setOccurrences(T item,
int occurrences) |
int |
size() |
int |
sizeDistinct() |
MutableSortedBag<T> |
take(int count) |
MutableStack<T> |
toStack() |
TreeBag<T> |
with(T... elements) |
TreeBag<T> |
with(T element) |
TreeBag<T> |
with(T element1,
T element2) |
TreeBag<T> |
with(T element1,
T element2,
T element3) |
TreeBag<T> |
withAll(Iterable<? extends T> iterable) |
TreeBag<T> |
without(T element) |
TreeBag<T> |
withoutAll(Iterable<? extends T> iterable) |
void |
writeExternal(ObjectOutput out) |
MutableSortedSet<Pair<T,Integer>> |
zipWithIndex() |
asParallel, asSynchronized, asUnmodifiable, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, collectWithIndex, collectWithIndex, collectWithOccurrences, countBy, countByEach, countByWith, detectLastIndex, dropWhile, flatCollect, partition, partitionWhile, partitionWith, reject, rejectWith, select, selectInstancesOf, selectWith, takeWhile, tap, toImmutable, toMapOfItemToCount, toReversed, zipaddAll, addAllIterable, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, bottomOccurrences, chunk, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, getFirst, getLast, groupByUniqueKey, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, removeAll, retainAll, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLong, topOccurrencescollect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, count, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, groupBy, groupByEach, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoWith, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toBag, toList, toSet, toSortedBag, toSortedBag, toSortedList, toSortedSet, toSortedSet, toStringOfItemToCountappendString, appendString, asLazy, containsAll, containsAllArguments, containsAllIterable, countWith, forEach, groupByUniqueKey, into, toArray, toArray, toBiMap, toMap, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSetBy, toString, zip, zipWithIndexflatCollectWith, selectDuplicates, selectUnique, toImmutableSortedBagasReversed, reverseForEach, reverseForEachWithIndexgetFirst, getFirstOptional, getLast, getLastOptional, rejectWithIndex, selectWithIndex, zip, zipWithIndexaggregateBy, aggregateInPlaceBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, makeString, makeString, makeString, makeString, max, maxBy, maxByOptional, maxOptional, maxOptional, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, reduce, reject, rejectWith, select, selectWith, sumByDouble, sumByFloat, sumByInt, sumByLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toImmutableBag, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toStringforEachspliteratorbottomOccurrences, topOccurrencesaggregateBy, collectWithOccurrences, reduceInPlace, reduceInPlace, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, toStringOfItemToCountaddAllIterable, aggregateBy, aggregateInPlaceBy, groupByUniqueKey, injectIntoWith, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLongaddAll, containsAll, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArraypublic TreeBag()
public TreeBag(Comparator<? super T> comparator)
public TreeBag(Comparator<? super T> comparator, Iterable<? extends T> iterable)
public static <E> TreeBag<E> newBag()
public static <E> TreeBag<E> newBag(Comparator<? super E> comparator)
public static <E> TreeBag<E> newBag(Comparator<? super E> comparator, Iterable<? extends E> iterable)
public static <E> TreeBag<E> newBagWith(E... elements)
public static <E> TreeBag<E> newBagWith(Comparator<? super E> comparator, E... elements)
public TreeBag<T> clone()
clone in interface MutableSortedBag<T>clone in class AbstractMutableSortedBag<T>public boolean equals(Object other)
public int hashCode()
public int sizeDistinct()
sizeDistinct in interface Bag<T>public void forEachWithOccurrences(ObjectIntProcedure<? super T> procedure)
forEachWithOccurrences in interface Bag<T>public MutableSortedBag<T> selectByOccurrences(IntPredicate predicate)
selectByOccurrences in interface Bag<T>selectByOccurrences in interface MutableBagIterable<T>selectByOccurrences in interface MutableSortedBag<T>selectByOccurrences in interface SortedBag<T>public int occurrencesOf(Object item)
occurrencesOf in interface Bag<T>public boolean anySatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
anySatisfyWithOccurrences in interface Bag<T>public boolean allSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
allSatisfyWithOccurrences in interface Bag<T>public boolean noneSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
noneSatisfyWithOccurrences in interface Bag<T>public T detectWithOccurrences(ObjectIntPredicate<? super T> predicate)
detectWithOccurrences in interface Bag<T>public boolean isEmpty()
isEmpty in interface Collection<T>isEmpty in interface RichIterable<T>isEmpty in class AbstractRichIterable<T>public boolean remove(Object item)
remove in interface Collection<T>public void clear()
clear in interface Collection<T>public boolean contains(Object o)
contains in interface Collection<T>contains in interface RichIterable<T>contains in class AbstractRichIterable<T>public int compareTo(SortedBag<T> otherBag)
compareTo in interface Comparable<SortedBag<T>>public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void each(Procedure<? super T> procedure)
each in interface RichIterable<T>public void forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)
forEachWithIndex in interface InternalIterable<T>forEachWithIndex in interface OrderedIterable<T>forEachWithIndex in class AbstractRichIterable<T>public void forEach(int fromIndex,
int toIndex,
Procedure<? super T> procedure)
forEach in interface OrderedIterable<T>public void forEachWithIndex(int fromIndex,
int toIndex,
ObjectIntProcedure<? super T> objectIntProcedure)
forEachWithIndex in interface OrderedIterable<T>public <P> void forEachWith(Procedure2<? super T,? super P> procedure, P parameter)
forEachWith in interface InternalIterable<T>forEachWith in class AbstractRichIterable<T>public int addOccurrences(T item, int occurrences)
addOccurrences in interface MutableBagIterable<T>public boolean removeOccurrences(Object item, int occurrences)
removeOccurrences in interface MutableBagIterable<T>public boolean setOccurrences(T item, int occurrences)
setOccurrences in interface MutableBagIterable<T>public TreeBag<T> without(T element)
without in interface MutableBagIterable<T>without in interface MutableSortedBag<T>without in interface MutableCollection<T>public TreeBag<T> withAll(Iterable<? extends T> iterable)
withAll in interface MutableBagIterable<T>withAll in interface MutableSortedBag<T>withAll in interface MutableCollection<T>public TreeBag<T> withoutAll(Iterable<? extends T> iterable)
withoutAll in interface MutableBagIterable<T>withoutAll in interface MutableSortedBag<T>withoutAll in interface MutableCollection<T>public TreeBag<T> with(T element)
with in interface MutableBagIterable<T>with in interface MutableSortedBag<T>with in interface MutableCollection<T>public MutableSortedBag<T> newEmpty()
newEmpty in interface MutableSortedBag<T>newEmpty in interface MutableCollection<T>public boolean removeIf(Predicate<? super T> predicate)
removeIf in interface MutableCollection<T>public <P> boolean removeIfWith(Predicate2<? super T,? super P> predicate, P parameter)
removeIfWith in interface MutableCollection<T>public boolean removeAllIterable(Iterable<?> iterable)
removeAllIterable in interface MutableCollection<T>public int size()
size in interface Collection<T>size in interface RichIterable<T>public int indexOf(Object object)
indexOf in interface OrderedIterable<T>public MutableSortedSet<Pair<T,Integer>> zipWithIndex()
zipWithIndex in interface Bag<T>zipWithIndex in interface MutableBagIterable<T>zipWithIndex in interface MutableSortedBag<T>zipWithIndex in interface SortedBag<T>zipWithIndex in interface MutableCollection<T>zipWithIndex in interface OrderedIterable<T>zipWithIndex in interface ReversibleIterable<T>zipWithIndex in interface SortedIterable<T>zipWithIndex in interface RichIterable<T>public MutableSortedSet<T> distinct()
distinct in interface MutableSortedBag<T>distinct in interface SortedBag<T>distinct in interface OrderedIterable<T>distinct in interface ReversibleIterable<T>distinct in interface SortedIterable<T>public <V> TreeBagMultimap<V,T> groupBy(Function<? super T,? extends V> function)
groupBy in interface Bag<T>groupBy in interface MutableBagIterable<T>groupBy in interface MutableSortedBag<T>groupBy in interface SortedBag<T>groupBy in interface MutableCollection<T>groupBy in interface OrderedIterable<T>groupBy in interface ReversibleIterable<T>groupBy in interface SortedIterable<T>groupBy in interface RichIterable<T>public <V> TreeBagMultimap<V,T> groupByEach(Function<? super T,? extends Iterable<V>> function)
groupByEach in interface Bag<T>groupByEach in interface MutableBagIterable<T>groupByEach in interface MutableSortedBag<T>groupByEach in interface SortedBag<T>groupByEach in interface MutableCollection<T>groupByEach in interface OrderedIterable<T>groupByEach in interface ReversibleIterable<T>groupByEach in interface SortedIterable<T>groupByEach in interface RichIterable<T>public int detectIndex(Predicate<? super T> predicate)
detectIndex in interface OrderedIterable<T>public <S> boolean corresponds(OrderedIterable<S> other, Predicate2<? super T,? super S> predicate)
corresponds in interface OrderedIterable<T>public MutableStack<T> toStack()
toStack in interface OrderedIterable<T>public MutableSortedBag<T> take(int count)
take in interface MutableSortedBag<T>take in interface SortedBag<T>take in interface ReversibleIterable<T>public MutableSortedBag<T> drop(int count)
drop in interface MutableSortedBag<T>drop in interface SortedBag<T>drop in interface ReversibleIterable<T>public Comparator<? super T> comparator()
comparator in interface SortedBag<T>comparator in interface SortedIterable<T>public boolean add(T item)
add in interface Collection<T>public RichIterable<T> distinctView()
distinctView in interface Bag<T>Copyright © 2004–2022. All rights reserved.