| Access | Constructor and Description |
|---|---|
| public |
| AbstractImmutableBag | back to summary |
|---|---|
| public AbstractImmutableBag() | |
| bottomOccurrences | back to summary |
|---|---|
| public ImmutableList Implements org. Doc from org. Returns the
| |
| chunk | back to summary |
|---|---|
| public RichIterable Implements org. Doc from org. Partitions elements in fixed size chunks.
| |
| collectBoolean | back to summary |
|---|---|
| public ImmutableBooleanBag collectBoolean(BooleanFunction<? super T> booleanFunction) Implements org. Doc from org. Returns a new primitive Example using a Java 8 lambda expression:
BooleanIterable licenses =
people.collectBoolean(person -> person.hasDrivingLicense());
| |
| collectByte | back to summary |
|---|---|
| public ImmutableByteBag collectByte(ByteFunction<? super T> byteFunction) Implements org. Doc from org. Returns a new primitive Example using a Java 8 lambda expression:
ByteIterable bytes =
people.collectByte(person -> person.getCode());
| |
| collectChar | back to summary |
|---|---|
| public ImmutableCharBag collectChar(CharFunction<? super T> charFunction) Implements org. Doc from org. Returns a new primitive Example using a Java 8 lambda expression:
CharIterable chars =
people.collectChar(person -> person.getMiddleInitial());
| |
| collectDouble | back to summary |
|---|---|
| public ImmutableDoubleBag collectDouble(DoubleFunction<? super T> doubleFunction) Implements org. Doc from org. Returns a new primitive Example using a Java 8 lambda expression:
DoubleIterable doubles =
people.collectDouble(person -> person.getMilesFromNorthPole());
| |
| collectFloat | back to summary |
|---|---|
| public ImmutableFloatBag collectFloat(FloatFunction<? super T> floatFunction) Implements org. Doc from org. Returns a new primitive Example using a Java 8 lambda expression:
FloatIterable floats =
people.collectFloat(person -> person.getHeightInInches());
| |
| collectInt | back to summary |
|---|---|
| public ImmutableIntBag collectInt(IntFunction<? super T> intFunction) Implements org. Doc from org. Returns a new primitive Example using a Java 8 lambda expression:
IntIterable ints =
people.collectInt(person -> person.getAge());
| |
| collectLong | back to summary |
|---|---|
| public ImmutableLongBag collectLong(LongFunction<? super T> longFunction) Implements org. Doc from org. Returns a new primitive Example using a Java 8 lambda expression:
LongIterable longs =
people.collectLong(person -> person.getGuid());
| |
| collectShort | back to summary |
|---|---|
| public ImmutableShortBag collectShort(ShortFunction<? super T> shortFunction) Implements org. Doc from org. Returns a new primitive Example using a Java 8 lambda expression:
ShortIterable shorts =
people.collectShort(person -> person.getNumberOfJunkMailItemsReceivedPerMonth());
| |
| collectWith | back to summary |
|---|---|
| public <P, V> ImmutableBag Implements org. Doc from org. Same as Example using a Java 8 lambda expression:
RichIterable<Integer> integers =
Lists.mutable.with(1, 2, 3).collectWith((each, parameter) -> each + parameter, Integer.valueOf(1));
| |
| collectWithOccurrences | back to summary |
|---|---|
| public <V> ImmutableBag Implements org. Doc from org. Iterates over the unique elements and their occurrences and collects the results of applying the specified function.
| |
| countBy | back to summary |
|---|---|
| public <V> ImmutableBag Overrides org. Overrides default org. Doc from org. This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.
| |
| countByEach | back to summary |
|---|---|
| public <V> ImmutableBag Overrides org. Overrides default org. Doc from org. This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.
| |
| countByWith | back to summary |
|---|---|
| public <V, P> ImmutableBag Overrides org. Overrides default org. Doc from org. This method will count the number of occurrences of each value calculated by applying the function to each element of the collection with the specified parameter as the second argument.
| |
| groupByUniqueKey | back to summary |
|---|---|
| public <V> ImmutableMap Overrides default org. Implements org. Doc from org. For each element of the iterable, the function is evaluated, and the results of these evaluations are collected into a new map, where the transformed value is the key. The generated keys must each be unique, or else an exception is thrown.
| |
| newWithoutAll | back to summary |
|---|---|
| public ImmutableBag Implements org. Doc from org. This method is similar to the
| |
| partition | back to summary |
|---|---|
| public PartitionImmutableBag Implements org. Doc from org. Filters a collection into a PartitionedIterable based on the evaluation of the predicate. Example using a Java 8 lambda expression:
PartitionIterable<Person> newYorkersAndNonNewYorkers =
people.partition(person -> person.getAddress().getState().getName().equals("New York"));
| |
| partitionWith | back to summary |
|---|---|
| public <P> PartitionImmutableBag Implements org. Doc from org. Filters a collection into a PartitionIterable based on the evaluation of the predicate. Example using a Java 8 lambda expression:
PartitionIterable<Person> newYorkersAndNonNewYorkers =
people.partitionWith((Person person, String state) -> person.getAddress().getState().getName().equals(state), "New York");
| |
| rejectWith | back to summary |
|---|---|
| public <P> ImmutableBag Implements org. Doc from org. Similar to
E.g. return a Example using a Java 8 lambda expression:
RichIterable<Person> rejected =
people.rejectWith((Person person, Integer age) -> person.getAge() < age, Integer.valueOf(18));
| |
| selectWith | back to summary |
|---|---|
| public <P> ImmutableBag Implements org. Doc from org. Similar to
E.g. return a Example using a Java 8 lambda expression:
RichIterable<Person> selected =
people.selectWith((Person person, Integer age) -> person.getAge()>= age, Integer.valueOf(18));
| |
| tap | back to summary |
|---|---|
| public ImmutableBag Implements org. Doc from org. Executes the Procedure for each element in the iterable and returns Example using a Java 8 lambda expression:
RichIterable<Person> tapped =
people.tap(person -> LOGGER.info(person.getName()));
| |
| toImmutable | back to summary |
|---|---|
| public ImmutableBag Implements org.
| |
| topOccurrences | back to summary |
|---|---|
| public ImmutableList Implements org. Doc from org. Returns the
| |