| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected int | computeHashCode(T item)
Implements abstract org.
|
| public static <E> HashBag | |
| public static <E> HashBag | |
| public static <E> HashBag | |
| public static <E> HashBag | |
| public static <E> HashBag | |
| public MutableBag | newEmpty()
Implements org. Creates a new empty mutable version of the same collection type. |
| 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 MutableBag | selectByOccurrences(IntPredicate predicate)
Implements org. Returns all elements of the bag that have a number of occurrences that satisfy the predicate. |
| public void | trimToSize()
Rehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels. |
| public HashBag | with(T element)
Overrides default org. This method allows mutable and fixed size collections the ability to add elements to their existing elements. |
| public HashBag | with(T... elements)
Overrides default org. This method allows mutable and fixed size collections the ability to add elements to their existing elements. |
| public HashBag | |
| public HashBag | |
| public HashBag | 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 HashBag | without(T element)
Overrides default org. This method allows mutable and fixed size collections the ability to remove elements from their existing elements. |
| public HashBag | 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. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| HashBag | back to summary |
|---|---|
| public HashBag() | |
| HashBag | back to summary |
|---|---|
| public HashBag(int size) | |
| HashBag | back to summary |
|---|---|
| private HashBag(MutableObjectIntMap<T> map) | |
| computeHashCode | back to summary |
|---|---|
| protected int computeHashCode(T item) Implements abstract org.
| |
| newBag | back to summary |
|---|---|
| public static <E> HashBag | |
| newBag | back to summary |
|---|---|
| public static <E> HashBag | |
| newBag | back to summary |
|---|---|
| public static <E> HashBag | |
| newBag | back to summary |
|---|---|
| public static <E> HashBag | |
| newBagWith | back to summary |
|---|---|
| public static <E> HashBag | |
| newEmpty | back to summary |
|---|---|
| public MutableBag Implements org. Doc from org. Creates a new empty mutable version of the same collection type. For example, if this instance is a FastList, this method will return a new empty FastList. If the class of this instance is immutable or fixed size (i.e. SingletonList) then a mutable alternative to the class will be provided.
| |
| readExternal | back to summary |
|---|---|
| public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException Implements java. Doc from 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. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.
| |
| selectByOccurrences | back to summary |
|---|---|
| public MutableBag Implements org. Doc from org. Returns all elements of the bag that have a number of occurrences that satisfy the predicate.
| |
| trimToSize | back to summary |
|---|---|
| public void trimToSize() Rehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.
| |
| with | back to summary |
|---|---|
| public HashBag Overrides default org. Doc from org. This method allows mutable and fixed size collections the ability to add elements to their existing elements. In order to support fixed size a new instance of a collection would have to be returned taking the elements of the original collection and appending the new element to form the new collection. In the case of mutable collections, the original collection is modified, and is returned. In order to use this method properly with mutable and fixed size collections the following approach must be taken:
MutableCollection<String> list = list.with("1");
list = list.with("2");
return list;
In the case of FixedSizeCollection a new instance of MutableCollection will be returned by with, and any
variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling add on itself.
| |
| with | back to summary |
|---|---|
| public HashBag Overrides default org. Doc from org. This method allows mutable and fixed size collections the ability to add elements to their existing elements. In order to support fixed size a new instance of a collection would have to be returned taking the elements of the original collection and appending the new element to form the new collection. In the case of mutable collections, the original collection is modified, and is returned. In order to use this method properly with mutable and fixed size collections the following approach must be taken:
MutableCollection<String> list = list.with("1");
list = list.with("2");
return list;
In the case of FixedSizeCollection a new instance of MutableCollection will be returned by with, and any
variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling add on itself.
| |
| with | back to summary |
|---|---|
| public HashBag | |
| with | back to summary |
|---|---|
| public HashBag | |
| withAll | back to summary |
|---|---|
| public HashBag Overrides default org. Doc from org. This method allows mutable and fixed size collections the ability to add multiple elements to their existing elements. In order to support fixed size a new instance of a collection would have to be returned taking the elements of the original collection and appending the new elements to form the new collection. In the case of mutable collections, the original collection is modified, and is returned. In order to use this method properly with mutable and fixed size collections the following approach must be taken:
MutableCollection<String> list = list.withAll(FastList.newListWith("1", "2"));
In the case of FixedSizeCollection a new instance of MutableCollection will be returned by withAll, and
any variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling addAll on itself.
| |
| without | back to summary |
|---|---|
| public HashBag Overrides default org. Doc from org. This method allows mutable and fixed size collections the ability to remove elements from their existing elements. In order to support fixed size a new instance of a collection would have to be returned containing the elements that would be left from the original collection after calling remove. In the case of mutable collections, the original collection is modified, and is returned. In order to use this method properly with mutable and fixed size collections the following approach must be taken:
MutableCollection<String> list = list.without("1");
list = list.without("2");
return list;
In the case of FixedSizeCollection a new instance of MutableCollection will be returned by without, and
any variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling remove on itself.
| |
| withoutAll | back to summary |
|---|---|
| public HashBag Overrides default org. Doc from org. This method allows mutable and fixed size collections the ability to remove multiple elements from their existing elements. In order to support fixed size a new instance of a collection would have to be returned containing the elements that would be left from the original collection after calling removeAll. In the case of mutable collections, the original collection is modified, and is returned. In order to use this method properly with mutable and fixed size collections the following approach must be taken:
MutableCollection<String> list = list.withoutAll(FastList.newListWith("1", "2"));
In the case of FixedSizeCollection a new instance of MutableCollection will be returned by withoutAll,
and any variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling removeAll on itself.
| |
| writeExternal | back to summary |
|---|---|
| public void writeExternal(ObjectOutput out) throws IOException Implements java. Doc from 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.
| |