public abstract class AbstractImmutableBag<T> extends AbstractImmutableCollection<T> implements com.gs.collections.api.bag.ImmutableBag<T>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractImmutableBag.ImmutableBagSerializationProxy<T> |
| Constructor and Description |
|---|
AbstractImmutableBag() |
| Modifier and Type | Method and Description |
|---|---|
com.gs.collections.api.bag.primitive.ImmutableBooleanBag |
collectBoolean(com.gs.collections.api.block.function.primitive.BooleanFunction<? super T> booleanFunction)
Returns a new primitive
boolean iterable with the results of applying the specified function on each element
of the source collection. |
com.gs.collections.api.bag.primitive.ImmutableByteBag |
collectByte(com.gs.collections.api.block.function.primitive.ByteFunction<? super T> byteFunction)
Returns a new primitive
byte iterable with the results of applying the specified function on each element
of the source collection. |
com.gs.collections.api.bag.primitive.ImmutableCharBag |
collectChar(com.gs.collections.api.block.function.primitive.CharFunction<? super T> charFunction)
Returns a new primitive
char iterable with the results of applying the specified function on each element
of the source collection. |
com.gs.collections.api.bag.primitive.ImmutableDoubleBag |
collectDouble(com.gs.collections.api.block.function.primitive.DoubleFunction<? super T> doubleFunction)
Returns a new primitive
double iterable with the results of applying the specified function on each element
of the source collection. |
com.gs.collections.api.bag.primitive.ImmutableFloatBag |
collectFloat(com.gs.collections.api.block.function.primitive.FloatFunction<? super T> floatFunction)
Returns a new primitive
float iterable with the results of applying the specified function on each element
of the source collection. |
com.gs.collections.api.bag.primitive.ImmutableIntBag |
collectInt(com.gs.collections.api.block.function.primitive.IntFunction<? super T> intFunction)
Returns a new primitive
int iterable with the results of applying the specified function on each element
of the source collection. |
com.gs.collections.api.bag.primitive.ImmutableLongBag |
collectLong(com.gs.collections.api.block.function.primitive.LongFunction<? super T> longFunction)
Returns a new primitive
long iterable with the results of applying the specified function on each element
of the source collection. |
com.gs.collections.api.bag.primitive.ImmutableShortBag |
collectShort(com.gs.collections.api.block.function.primitive.ShortFunction<? super T> shortFunction)
Returns a new primitive
short iterable with the results of applying the specified function on each element
of the source collection. |
protected com.gs.collections.api.collection.MutableCollection<T> |
newMutable(int size) |
java.lang.String |
toStringOfItemToCount()
Returns a string representation of this bag.
|
add, addAll, aggregateBy, aggregateInPlaceBy, allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, chunk, clear, collect, collectIf, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, detect, detectIfNone, flatCollect, forEachWith, forEachWithIndex, injectInto, injectInto, injectInto, injectInto, injectInto, isEmpty, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, notEmpty, reject, rejectWith, remove, removeAll, removeAllFrom, retainAll, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toList, toMap, toSet, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndexclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcollect, collectIf, flatCollect, groupBy, groupByEach, newWith, newWithAll, newWithout, newWithoutAll, partition, reject, select, selectByOccurrences, selectInstancesOf, zip, zipWithIndexequals, forEachWithOccurrences, hashCode, occurrencesOf, sizeDistinct, toImmutable, toMapOfItemToCountaggregateBy, aggregateInPlaceByallSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, chunk, collect, collectIf, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, detect, detectIfNone, flatCollect, getFirst, getLast, groupBy, groupByEach, injectInto, injectInto, injectInto, injectInto, injectInto, isEmpty, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, notEmpty, reject, rejectWith, select, selectWith, size, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toList, toMap, toSet, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndexprotected com.gs.collections.api.collection.MutableCollection<T> newMutable(int size)
newMutable in class AbstractImmutableCollection<T>public com.gs.collections.api.bag.primitive.ImmutableBooleanBag collectBoolean(com.gs.collections.api.block.function.primitive.BooleanFunction<? super T> booleanFunction)
com.gs.collections.api.RichIterableboolean iterable with the results of applying the specified function on each element
of the source collection. This method is also commonly called transform or map.
e.g.
return people.collectBoolean(new BooleanFunction<Person>()
{
public boolean booleanValueOf(Person person)
{
return person.hasDrivingLicense();
}
});
collectBoolean in interface com.gs.collections.api.bag.Bag<T>collectBoolean in interface com.gs.collections.api.bag.ImmutableBag<T>collectBoolean in interface com.gs.collections.api.collection.ImmutableCollection<T>collectBoolean in interface com.gs.collections.api.RichIterable<T>collectBoolean in class AbstractImmutableCollection<T>public com.gs.collections.api.bag.primitive.ImmutableByteBag collectByte(com.gs.collections.api.block.function.primitive.ByteFunction<? super T> byteFunction)
com.gs.collections.api.RichIterablebyte iterable with the results of applying the specified function on each element
of the source collection. This method is also commonly called transform or map.
e.g.
return people.collectByte(new ByteFunction<Person>()
{
public byte byteValueOf(Person person)
{
return person.getCode();
}
});
collectByte in interface com.gs.collections.api.bag.Bag<T>collectByte in interface com.gs.collections.api.bag.ImmutableBag<T>collectByte in interface com.gs.collections.api.collection.ImmutableCollection<T>collectByte in interface com.gs.collections.api.RichIterable<T>collectByte in class AbstractImmutableCollection<T>public com.gs.collections.api.bag.primitive.ImmutableCharBag collectChar(com.gs.collections.api.block.function.primitive.CharFunction<? super T> charFunction)
com.gs.collections.api.RichIterablechar iterable with the results of applying the specified function on each element
of the source collection. This method is also commonly called transform or map.
e.g.
return people.collectChar(new CharFunction<Person>()
{
public char charValueOf(Person person)
{
return person.getMiddleInitial();
}
});
collectChar in interface com.gs.collections.api.bag.Bag<T>collectChar in interface com.gs.collections.api.bag.ImmutableBag<T>collectChar in interface com.gs.collections.api.collection.ImmutableCollection<T>collectChar in interface com.gs.collections.api.RichIterable<T>collectChar in class AbstractImmutableCollection<T>public com.gs.collections.api.bag.primitive.ImmutableDoubleBag collectDouble(com.gs.collections.api.block.function.primitive.DoubleFunction<? super T> doubleFunction)
com.gs.collections.api.RichIterabledouble iterable with the results of applying the specified function on each element
of the source collection. This method is also commonly called transform or map.
e.g.
return people.collectDouble(new DoubleFunction<Person>()
{
public double doubleValueOf(Person person)
{
return person.getMilesFromNorthPole();
}
});
collectDouble in interface com.gs.collections.api.bag.Bag<T>collectDouble in interface com.gs.collections.api.bag.ImmutableBag<T>collectDouble in interface com.gs.collections.api.collection.ImmutableCollection<T>collectDouble in interface com.gs.collections.api.RichIterable<T>collectDouble in class AbstractImmutableCollection<T>public com.gs.collections.api.bag.primitive.ImmutableFloatBag collectFloat(com.gs.collections.api.block.function.primitive.FloatFunction<? super T> floatFunction)
com.gs.collections.api.RichIterablefloat iterable with the results of applying the specified function on each element
of the source collection. This method is also commonly called transform or map.
e.g.
return people.collectFloat(new FloatFunction<Person>()
{
public float floatValueOf(Person person)
{
return person.getHeightInInches();
}
});
collectFloat in interface com.gs.collections.api.bag.Bag<T>collectFloat in interface com.gs.collections.api.bag.ImmutableBag<T>collectFloat in interface com.gs.collections.api.collection.ImmutableCollection<T>collectFloat in interface com.gs.collections.api.RichIterable<T>collectFloat in class AbstractImmutableCollection<T>public com.gs.collections.api.bag.primitive.ImmutableIntBag collectInt(com.gs.collections.api.block.function.primitive.IntFunction<? super T> intFunction)
com.gs.collections.api.RichIterableint iterable with the results of applying the specified function on each element
of the source collection. This method is also commonly called transform or map.
e.g.
return people.collectInt(new IntFunction<Person>()
{
public int intValueOf(Person person)
{
return person.getAge();
}
});
collectInt in interface com.gs.collections.api.bag.Bag<T>collectInt in interface com.gs.collections.api.bag.ImmutableBag<T>collectInt in interface com.gs.collections.api.collection.ImmutableCollection<T>collectInt in interface com.gs.collections.api.RichIterable<T>collectInt in class AbstractImmutableCollection<T>public com.gs.collections.api.bag.primitive.ImmutableLongBag collectLong(com.gs.collections.api.block.function.primitive.LongFunction<? super T> longFunction)
com.gs.collections.api.RichIterablelong iterable with the results of applying the specified function on each element
of the source collection. This method is also commonly called transform or map.
e.g.
return people.collectLong(new LongFunction<Person>()
{
public long longValueOf(Person person)
{
return person.getGuid();
}
});
collectLong in interface com.gs.collections.api.bag.Bag<T>collectLong in interface com.gs.collections.api.bag.ImmutableBag<T>collectLong in interface com.gs.collections.api.collection.ImmutableCollection<T>collectLong in interface com.gs.collections.api.RichIterable<T>collectLong in class AbstractImmutableCollection<T>public com.gs.collections.api.bag.primitive.ImmutableShortBag collectShort(com.gs.collections.api.block.function.primitive.ShortFunction<? super T> shortFunction)
com.gs.collections.api.RichIterableshort iterable with the results of applying the specified function on each element
of the source collection. This method is also commonly called transform or map.
e.g.
return people.collectShort(new ShortFunction<Person>()
{
public short shortValueOf(Person person)
{
return person.getNumberOfJunkMailItemsReceivedPerMonth();
}
});
collectShort in interface com.gs.collections.api.bag.Bag<T>collectShort in interface com.gs.collections.api.bag.ImmutableBag<T>collectShort in interface com.gs.collections.api.collection.ImmutableCollection<T>collectShort in interface com.gs.collections.api.RichIterable<T>collectShort in class AbstractImmutableCollection<T>public java.lang.String toStringOfItemToCount()
com.gs.collections.api.bag.BagBag.forEachWithOccurrences(ObjectIntProcedure)
and Iterable.iterator(). The element-count mappings are enclosed in braces ("{}"). Adjacent mappings are
separated by the characters ", " (comma and space). Each element-count mapping is rendered as the element
followed by an equals sign ("=") followed by the number of ooccurrences. Elements and are converted to
strings as by String.valueOf(Object).
The string representation is similar to AbstractMap.toString(), not RichIterable.toString().toStringOfItemToCount in interface com.gs.collections.api.bag.Bag<T>