Class UnmodifiableByteBag
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableByteCollection
-
- org.eclipse.collections.impl.bag.mutable.primitive.UnmodifiableByteBag
-
- All Implemented Interfaces:
java.io.Serializable,ByteBag,MutableByteBag,ByteIterable,MutableByteCollection,PrimitiveIterable
public class UnmodifiableByteBag extends AbstractUnmodifiableByteCollection implements MutableByteBag
This file was automatically generated from template file unmodifiablePrimitiveBag.stg.- Since:
- 3.1.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description UnmodifiableByteBag(MutableByteBag bag)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOccurrences(byte item, int occurrences)MutableByteBagasSynchronized()MutableByteBagasUnmodifiable()MutableList<ByteIntPair>bottomOccurrences(int count)Returns thecountleast frequently occurring items.<V> MutableBag<V>collect(ByteToObjectFunction<? extends V> function)Returns a new collection with the results of applying the specified function on each element of the source collection.booleanequals(java.lang.Object otherBag)Follows the same general contract asBag.equals(Object).voidforEachWithOccurrences(ByteIntProcedure procedure)For each distinct item, with the number of occurrences, execute the specified procedure.private MutableByteBaggetMutableByteBag()inthashCode()Follows the same general contract asBag.hashCode().MutableByteBagnewEmpty()Creates a new empty mutable version of the same Bag type.intoccurrencesOf(byte item)The occurrences of a distinct item in the bag.MutableByteBagreject(BytePredicate predicate)Returns a new ByteIterable with all of the elements in the ByteIterable that return false for the specified predicate.booleanremoveOccurrences(byte item, int occurrences)MutableByteBagselect(BytePredicate predicate)Returns a new ByteIterable with all of the elements in the ByteIterable that return true for the specified predicate.MutableByteBagselectByOccurrences(IntPredicate predicate)Returns all elements of the bag that have a number of occurrences that satisfy the predicate.MutableByteSetselectUnique()Returns all elements of the bag that have exactly one occurrence.intsizeDistinct()The size of the Bag when counting only distinct elements.ImmutableByteBagtoImmutable()Returns an immutable copy of this bag.MutableList<ByteIntPair>topOccurrences(int count)Returns thecountmost frequently occurring items.UnmodifiableByteBagwith(byte element)UnmodifiableByteBagwithAll(ByteIterable elements)UnmodifiableByteBagwithout(byte element)UnmodifiableByteBagwithoutAll(ByteIterable elements)-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableByteCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, average, byteIterator, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, getByteCollection, injectInto, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, reduce, reduceIfEmpty, remove, removeAll, removeAll, removeIf, retainAll, retainAll, size, sum, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.ByteBag
toStringOfItemToCount
-
Methods inherited from interface org.eclipse.collections.api.ByteIterable
allSatisfy, anySatisfy, asLazy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, flatCollect, forEach, injectInto, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.MutableByteBag
selectDuplicates, tap
-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableByteCollection
add, addAll, addAll, byteIterator, clear, remove, removeAll, removeAll, removeIf, retainAll, retainAll
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UnmodifiableByteBag
public UnmodifiableByteBag(MutableByteBag bag)
-
-
Method Detail
-
getMutableByteBag
private MutableByteBag getMutableByteBag()
-
with
public UnmodifiableByteBag with(byte element)
- Specified by:
within interfaceMutableByteBag- Specified by:
within interfaceMutableByteCollection- Overrides:
within classAbstractUnmodifiableByteCollection
-
without
public UnmodifiableByteBag without(byte element)
- Specified by:
withoutin interfaceMutableByteBag- Specified by:
withoutin interfaceMutableByteCollection- Overrides:
withoutin classAbstractUnmodifiableByteCollection
-
withAll
public UnmodifiableByteBag withAll(ByteIterable elements)
- Specified by:
withAllin interfaceMutableByteBag- Specified by:
withAllin interfaceMutableByteCollection- Overrides:
withAllin classAbstractUnmodifiableByteCollection
-
withoutAll
public UnmodifiableByteBag withoutAll(ByteIterable elements)
- Specified by:
withoutAllin interfaceMutableByteBag- Specified by:
withoutAllin interfaceMutableByteCollection- Overrides:
withoutAllin classAbstractUnmodifiableByteCollection
-
addOccurrences
public void addOccurrences(byte item, int occurrences)- Specified by:
addOccurrencesin interfaceMutableByteBag
-
removeOccurrences
public boolean removeOccurrences(byte item, int occurrences)- Specified by:
removeOccurrencesin interfaceMutableByteBag
-
sizeDistinct
public int sizeDistinct()
Description copied from interface:ByteBagThe size of the Bag when counting only distinct elements.- Specified by:
sizeDistinctin interfaceByteBag
-
occurrencesOf
public int occurrencesOf(byte item)
Description copied from interface:ByteBagThe occurrences of a distinct item in the bag.- Specified by:
occurrencesOfin interfaceByteBag
-
forEachWithOccurrences
public void forEachWithOccurrences(ByteIntProcedure procedure)
Description copied from interface:ByteBagFor each distinct item, with the number of occurrences, execute the specified procedure.- Specified by:
forEachWithOccurrencesin interfaceByteBag
-
selectByOccurrences
public MutableByteBag selectByOccurrences(IntPredicate predicate)
Description copied from interface:MutableByteBagReturns all elements of the bag that have a number of occurrences that satisfy the predicate.- Specified by:
selectByOccurrencesin interfaceByteBag- Specified by:
selectByOccurrencesin interfaceMutableByteBag
-
selectUnique
public MutableByteSet selectUnique()
Description copied from interface:MutableByteBagReturns all elements of the bag that have exactly one occurrence.- Specified by:
selectUniquein interfaceByteBag- Specified by:
selectUniquein interfaceMutableByteBag
-
topOccurrences
public MutableList<ByteIntPair> topOccurrences(int count)
Description copied from interface:MutableByteBagReturns thecountmost frequently occurring items. In the event of a tie, all of the items with the number of occurrences that match the occurrences of the last item will be returned.- Specified by:
topOccurrencesin interfaceByteBag- Specified by:
topOccurrencesin interfaceMutableByteBag
-
bottomOccurrences
public MutableList<ByteIntPair> bottomOccurrences(int count)
Description copied from interface:MutableByteBagReturns thecountleast frequently occurring items. In the event of a tie, all of the items with the number of occurrences that match the occurrences of the last item will be returned.- Specified by:
bottomOccurrencesin interfaceByteBag- Specified by:
bottomOccurrencesin interfaceMutableByteBag
-
select
public MutableByteBag select(BytePredicate predicate)
Description copied from interface:ByteIterableReturns a new ByteIterable with all of the elements in the ByteIterable that return true for the specified predicate.- Specified by:
selectin interfaceByteBag- Specified by:
selectin interfaceByteIterable- Specified by:
selectin interfaceMutableByteBag- Specified by:
selectin interfaceMutableByteCollection- Overrides:
selectin classAbstractUnmodifiableByteCollection
-
reject
public MutableByteBag reject(BytePredicate predicate)
Description copied from interface:ByteIterableReturns a new ByteIterable with all of the elements in the ByteIterable that return false for the specified predicate.- Specified by:
rejectin interfaceByteBag- Specified by:
rejectin interfaceByteIterable- Specified by:
rejectin interfaceMutableByteBag- Specified by:
rejectin interfaceMutableByteCollection- Overrides:
rejectin classAbstractUnmodifiableByteCollection
-
collect
public <V> MutableBag<V> collect(ByteToObjectFunction<? extends V> function)
Description copied from interface:ByteIterableReturns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.- Specified by:
collectin interfaceByteBag- Specified by:
collectin interfaceByteIterable- Specified by:
collectin interfaceMutableByteBag- Specified by:
collectin interfaceMutableByteCollection- Overrides:
collectin classAbstractUnmodifiableByteCollection
-
equals
public boolean equals(java.lang.Object otherBag)
Description copied from interface:ByteBagFollows the same general contract asBag.equals(Object).
-
hashCode
public int hashCode()
Description copied from interface:ByteBagFollows the same general contract asBag.hashCode().
-
asUnmodifiable
public MutableByteBag asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableByteBag- Specified by:
asUnmodifiablein interfaceMutableByteCollection- Overrides:
asUnmodifiablein classAbstractUnmodifiableByteCollection
-
asSynchronized
public MutableByteBag asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableByteBag- Specified by:
asSynchronizedin interfaceMutableByteCollection- Overrides:
asSynchronizedin classAbstractUnmodifiableByteCollection
-
toImmutable
public ImmutableByteBag toImmutable()
Description copied from interface:MutableByteBagReturns an immutable copy of this bag.- Specified by:
toImmutablein interfaceByteBag- Specified by:
toImmutablein interfaceMutableByteBag- Specified by:
toImmutablein interfaceMutableByteCollection- Overrides:
toImmutablein classAbstractUnmodifiableByteCollection
-
newEmpty
public MutableByteBag newEmpty()
Description copied from interface:MutableByteBagCreates a new empty mutable version of the same Bag type.- Specified by:
newEmptyin interfaceMutableByteBag- Specified by:
newEmptyin interfaceMutableByteCollection- Since:
- 9.2.
-
-