| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private MutableSortedMap | |
| private static final long | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| private | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(T item)
Implements java. Ensures that this collection contains the specified element (optional operation). |
| public int | addOccurrences(T item, int occurrences)
Implements org. Add number of |
| public boolean | allSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
Implements org. Returns true if the predicate evaluates to true for all elements of the Bag. |
| public boolean | anySatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
Implements org. Returns true if the predicate evaluates to true for any element of the Bag. |
| public void | clear()
Implements java. Removes all of the elements from this collection (optional operation). |
| public TreeBag | clone()
Implements abstract org. Implements org. Creates and returns a copy of this object. |
| public Comparator | comparator()
Implements org. Returns the comparator used to order the elements in this bag, or null if this bag uses the natural ordering of its elements. |
| public int | compareTo(SortedBag<T> otherBag)
Implements java. Compares this object with the specified object for order. |
| public boolean | contains(Object o)
Overrides org. Implements org. Returns true if the iterable has an element which responds true to element.equals(object). |
| public <S> boolean | corresponds(OrderedIterable<S> other, Predicate2<? super T, ? super S> predicate)
Implements org. Returns true if both OrderedIterables have the same length
and |
| public int | detectIndex(Predicate<? super T> predicate)
Implements org. Returns the index of the first element of the |
| public T | detectWithOccurrences(ObjectIntPredicate<? super T> predicate)
Implements org. Returns an element of the Bag that satisfies the predicate or null if such an element does not exist |
| public MutableSortedSet | distinct()
Implements org. Returns a new |
| public RichIterable | distinctView()
Overrides default org. Returns an unmodifiable view on the distinct elements with the same complexity as the Bag implementation. |
| public MutableSortedBag | drop(int count)
Implements org. Returns an iterable after skipping the first |
| public void | each(Procedure<? super T> procedure)
Implements org. The procedure is executed for each element in the iterable. |
| public boolean | equals(Object other)
Overrides java. Implements org. Two bags |
| public void | forEach(int fromIndex, int toIndex, Procedure<? super T> procedure)
Implements org. Iterates over the section of the iterable covered by the specified inclusive indexes. |
| public <P> void | forEachWith(Procedure2<? super T, ? super P> procedure, P parameter)
Overrides org. Implements org. The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument. |
| public void | forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)
Overrides org. Implements org. Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure. |
| public void | forEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure<? super T> objectIntProcedure)
Implements org. Iterates over the section of the iterable covered by the specified inclusive indexes. |
| public void | forEachWithOccurrences(ObjectIntProcedure<? super T> procedure)
Implements org. For each distinct item, with the number of occurrences, execute the specified procedure. |
| protected RichIterable | getKeysView()
Implements abstract org.
|
| public <V> TreeBagMultimap | groupBy(Function<? super T, ? extends V> function)
Implements org. For each element of the iterable, the function is evaluated and the results of these evaluations are collected into a new multimap, where the transformed value is the key and the original values are added to the same (or similar) species of collection as the source iterable. |
| public <V> TreeBagMultimap | groupByEach(Function<? super T, ? extends Iterable<V>> function)
Implements org. Similar to |
| public int | hashCode()
Overrides java. Implements org. Returns the hash code for this Bag, defined as this. |
| public int | indexOf(Object object)
Overrides default org. Returns the index of the first occurrence of the specified item in this iterable, or -1 if this iterable does not contain the item. |
| public boolean | isEmpty()
Overrides org. Implements org. Returns true if this iterable has zero items. |
| public Iterator | iterator()
Implements java. Returns an iterator over elements of type |
| public static <E> TreeBag | |
| public static <E> TreeBag | |
| public static <E> TreeBag | |
| public static <E> TreeBag | |
| public static <E> TreeBag | |
| public static <E> TreeBag | |
| public MutableSortedBag | newEmpty()
Implements org. Creates a new empty mutable version of the same collection type. |
| public boolean | noneSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
Implements org. Returns true if the Bag is empty or if the predicate evaluates to false for all elements of the Bag. |
| public int | occurrencesOf(Object item)
Implements org. The occurrences of a distinct item in the bag. |
| public void | readExternal(ObjectInput in)
Implements java. The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. |
| public boolean | remove(Object item)
Implements java. Removes a single instance of the specified element from this collection, if it is present (optional operation). |
| public boolean | removeAllIterable(Iterable<?> iterable)
Implements org.
|
| public boolean | removeIf(Predicate<? super T> predicate)
Implements org. Removes all elements in the collection that evaluate to true for the specified predicate. |
| public <P> boolean | removeIfWith(Predicate2<? super T, ? super P> predicate, P parameter)
Implements org. Removes all elements in the collection that evaluate to true for the specified predicate2 and parameter. |
| public boolean | removeOccurrences(Object item, int occurrences)
Implements org.
|
| public MutableSortedBag | selectByOccurrences(IntPredicate predicate)
Implements org. Returns all elements of the bag that have a number of occurrences that satisfy the predicate. |
| public boolean | setOccurrences(T item, int occurrences)
Implements org.
|
| public int | size()
Implements org. Returns the number of items in this iterable. |
| public int | sizeDistinct()
Implements org. The size of the Bag when counting only distinct elements. |
| public MutableSortedBag | take(int count)
Implements org. Returns the first |
| public MutableStack | toStack()
Overrides default org. Converts the OrderedIterable to a mutable MutableStack implementation. |
| public TreeBag | with(T element)
Overrides default org. This method allows mutable and fixed size collections the ability to add elements to their existing elements. |
| public TreeBag | with(T... elements)
Overrides default org. This method allows mutable and fixed size collections the ability to add elements to their existing elements. |
| public TreeBag | |
| public TreeBag | |
| public TreeBag | withAll(Iterable<? extends T> iterable)
Overrides default org. This method allows mutable and fixed size collections the ability to add multiple elements to their existing elements. |
| public TreeBag | without(T element)
Overrides default org. This method allows mutable and fixed size collections the ability to remove elements from their existing elements. |
| public TreeBag | withoutAll(Iterable<? extends T> iterable)
Overrides default org. This method allows mutable and fixed size collections the ability to remove multiple elements from their existing elements. |
| public void | writeExternal(ObjectOutput out)
Implements java. The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays. |
| public MutableSortedSet | zipWithIndex()
Implements org. Zips this |