Class UnmodifiableByteStack
java.lang.Object
org.eclipse.collections.impl.stack.mutable.primitive.UnmodifiableByteStack
- All Implemented Interfaces:
Serializable,ByteIterable,OrderedByteIterable,PrimitiveIterable,ByteStack,MutableByteStack
This file was automatically generated from template file unmodifiablePrimitiveStack.stg.
- Since:
- 3.1.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallSatisfy(BytePredicate predicate) Returns true if all of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.booleananySatisfy(BytePredicate predicate) Returns true if any of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.voidappendString(Appendable appendable) Prints a string representation of this collection onto the givenAppendable.voidappendString(Appendable appendable, String separator) Prints a string representation of this collection onto the givenAppendable.voidappendString(Appendable appendable, String start, String separator, String end) Prints a string representation of this collection onto the givenAppendable.asLazy()Returns a LazyByteIterable adapter wrapping the source ByteIterable.doubleaverage()Returns a primitive iterator that can be used to iterate over the ByteIterable in an imperative style.chunk(int size) Partitions elements in fixed size chunks.voidclear()Clears the Stack<V> MutableStack<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.<V> MutableStack<V>collectWithIndex(ByteIntToObjectFunction<? extends V> function) Returns a new MutableStack using results obtained by applying the specified function to each element and its corresponding index.<V,R extends Collection<V>>
RcollectWithIndex(ByteIntToObjectFunction<? extends V> function, R target) Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.booleancontains(byte value) Returns true if the value is contained in the ByteIterable, and false if it is not.booleancontainsAll(byte... source) Returns true if all of the values specified in the source array are contained in the ByteIterable, and false if they are not.booleancontainsAll(ByteIterable source) Returns true if all of the values specified in the source ByteIterable are contained in the ByteIterable, and false if they are not.intcount(BytePredicate predicate) Returns a count of the number of elements in the ByteIterable that return true for the specified predicate.bytedetectIfNone(BytePredicate predicate, byte ifNone) voideach(ByteProcedure procedure) A synonym for forEach.booleanFollows the same general contract asStackIterable.equals(Object).voidforEachWithIndex(ByteIntProcedure procedure) bytegetFirst()inthashCode()Follows the same general contract asStackIterable.hashCode().intindexOf(byte value) <T> TinjectInto(T injectedValue, ObjectByteToObjectFunction<? super T, ? extends T> function) <T> TinjectIntoWithIndex(T injectedValue, ObjectByteIntToObjectFunction<? super T, ? extends T> function) booleanisEmpty()Returns true if this iterable has zero items.Returns a string representation of this collection by delegating toPrimitiveIterable.makeString(String)and defaulting the separator parameter to the characters", "(comma and space).makeString(String separator) Returns a string representation of this collection by delegating toPrimitiveIterable.makeString(String, String, String)and defaulting the start and end parameters to""(the empty String).makeString(String start, String separator, String end) Returns a string representation of this collection with the elements separated by the specified separator and enclosed between the start and end strings.bytemax()bytemaxIfEmpty(byte defaultValue) doublemedian()bytemin()byteminIfEmpty(byte defaultValue) newEmpty()Creates a new empty mutable version of the same stack type.booleannoneSatisfy(BytePredicate predicate) Returns true if none of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.booleannotEmpty()The English equivalent of !this.isEmpty()bytepeek()Returns the top of the stack.peek(int count) Returns ByteList of the number of elements specified by the count, beginning with the top of the stack.bytepeekAt(int index) Returns the element at the specified index.bytepop()Removes and returns the top element of the stack.pop(int count) Removes and returns a ByteList of the number of elements specified by the count, beginning with the top of the stack.voidpush(byte item) Adds an item to the top of the stack.reject(BytePredicate predicate) Returns a new ByteIterable with all of the elements in the ByteIterable that return false for the specified predicate.select(BytePredicate predicate) Returns a new ByteIterable with all of the elements in the ByteIterable that return true for the specified predicate.intsize()Returns the number of items in this iterable.longsum()byte[]toArray()Converts the ByteIterable to a primitive byte array.byte[]toArray(byte[] target) Converts the ByteIterable to a primitive byte array.toBag()Converts the ByteIterable to a new MutableByteBag.toList()Converts the ByteIterable to a new MutableByteList.toSet()Converts the ByteIterable to a new MutableByteSet.byte[]toString()Returns a string with the elements of this iterable separated by commas with spaces and enclosed in square brackets.Methods inherited from interface org.eclipse.collections.api.ByteIterable
averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, medianIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toSortedList, toSortedListBy, toSortedListByMethods inherited from interface org.eclipse.collections.api.stack.primitive.MutableByteStack
rejectWithIndex, selectWithIndex, tapMethods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedByteIterable
rejectWithIndex, selectWithIndex
-
Constructor Details
-
UnmodifiableByteStack
-
-
Method Details
-
push
public void push(byte item) Description copied from interface:MutableByteStackAdds an item to the top of the stack.- Specified by:
pushin interfaceMutableByteStack
-
pop
public byte pop()Description copied from interface:MutableByteStackRemoves and returns the top element of the stack.- Specified by:
popin interfaceMutableByteStack
-
pop
Description copied from interface:MutableByteStackRemoves and returns a ByteList of the number of elements specified by the count, beginning with the top of the stack.- Specified by:
popin interfaceMutableByteStack
-
peek
public byte peek()Description copied from interface:ByteStackReturns the top of the stack. -
peek
Description copied from interface:ByteStackReturns ByteList of the number of elements specified by the count, beginning with the top of the stack. -
peekAt
public byte peekAt(int index) Description copied from interface:ByteStackReturns the element at the specified index. -
size
public int size()Description copied from interface:PrimitiveIterableReturns the number of items in this iterable.- Specified by:
sizein interfacePrimitiveIterable
-
isEmpty
public boolean isEmpty()Description copied from interface:PrimitiveIterableReturns true if this iterable has zero items.- Specified by:
isEmptyin interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()Description copied from interface:PrimitiveIterableThe English equivalent of !this.isEmpty()- Specified by:
notEmptyin interfacePrimitiveIterable
-
clear
public void clear()Description copied from interface:MutableByteStackClears the Stack- Specified by:
clearin interfaceMutableByteStack
-
contains
public boolean contains(byte value) Description copied from interface:ByteIterableReturns true if the value is contained in the ByteIterable, and false if it is not.- Specified by:
containsin interfaceByteIterable
-
containsAll
public boolean containsAll(byte... source) Description copied from interface:ByteIterableReturns true if all of the values specified in the source array are contained in the ByteIterable, and false if they are not.- Specified by:
containsAllin interfaceByteIterable
-
containsAll
Description copied from interface:ByteIterableReturns true if all of the values specified in the source ByteIterable are contained in the ByteIterable, and false if they are not.- Specified by:
containsAllin interfaceByteIterable
-
byteIterator
Description copied from interface:ByteIterableReturns a primitive iterator that can be used to iterate over the ByteIterable in an imperative style.- Specified by:
byteIteratorin interfaceByteIterable
-
each
Description copied from interface:ByteIterableA synonym for forEach.- Specified by:
eachin interfaceByteIterable- Since:
- 7.0.
-
count
Description copied from interface:ByteIterableReturns a count of the number of elements in the ByteIterable that return true for the specified predicate.- Specified by:
countin interfaceByteIterable
-
anySatisfy
Description copied from interface:ByteIterableReturns true if any of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.- Specified by:
anySatisfyin interfaceByteIterable
-
allSatisfy
Description copied from interface:ByteIterableReturns true if all of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.- Specified by:
allSatisfyin interfaceByteIterable
-
noneSatisfy
Description copied from interface:ByteIterableReturns true if none of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.- Specified by:
noneSatisfyin interfaceByteIterable
-
detectIfNone
- Specified by:
detectIfNonein interfaceByteIterable
-
select
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 interfaceByteIterable- Specified by:
selectin interfaceByteStack- Specified by:
selectin interfaceMutableByteStack- Specified by:
selectin interfaceOrderedByteIterable
-
reject
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 interfaceByteIterable- Specified by:
rejectin interfaceByteStack- Specified by:
rejectin interfaceMutableByteStack- Specified by:
rejectin interfaceOrderedByteIterable
-
collect
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 interfaceByteIterable- Specified by:
collectin interfaceByteStack- Specified by:
collectin interfaceMutableByteStack- Specified by:
collectin interfaceOrderedByteIterable
-
sum
public long sum()- Specified by:
sumin interfaceByteIterable
-
max
public byte max()- Specified by:
maxin interfaceByteIterable
-
min
public byte min()- Specified by:
minin interfaceByteIterable
-
minIfEmpty
public byte minIfEmpty(byte defaultValue) - Specified by:
minIfEmptyin interfaceByteIterable
-
maxIfEmpty
public byte maxIfEmpty(byte defaultValue) - Specified by:
maxIfEmptyin interfaceByteIterable
-
average
public double average()- Specified by:
averagein interfaceByteIterable
-
median
public double median()- Specified by:
medianin interfaceByteIterable
-
toSortedList
- Specified by:
toSortedListin interfaceByteIterable
-
toSortedArray
public byte[] toSortedArray()- Specified by:
toSortedArrayin interfaceByteIterable
-
toArray
public byte[] toArray()Description copied from interface:ByteIterableConverts the ByteIterable to a primitive byte array.- Specified by:
toArrayin interfaceByteIterable
-
toArray
public byte[] toArray(byte[] target) Description copied from interface:ByteIterableConverts the ByteIterable to a primitive byte array. If the collection fits into the provided array it is used to store its elements and is returned from the method, otherwise a new array of the appropriate size is allocated and returned. If the iterable is empty, the target array is returned unchanged.- Specified by:
toArrayin interfaceByteIterable
-
toString
Description copied from interface:PrimitiveIterableReturns a string with the elements of this iterable separated by commas with spaces and enclosed in square brackets.Assert.assertEquals("[]", IntLists.mutable.empty().toString()); Assert.assertEquals("[1]", IntLists.mutable.with(1).toString()); Assert.assertEquals("[1, 2, 3]", IntLists.mutable.with(1, 2, 3).toString());- Specified by:
toStringin interfacePrimitiveIterable- Overrides:
toStringin classObject- Returns:
- a string representation of this PrimitiveIterable
- See Also:
-
makeString
Description copied from interface:PrimitiveIterableReturns a string representation of this collection by delegating toPrimitiveIterable.makeString(String)and defaulting the separator parameter to the characters", "(comma and space).- Specified by:
makeStringin interfacePrimitiveIterable- Returns:
- a string representation of this collection.
-
makeString
Description copied from interface:PrimitiveIterableReturns a string representation of this collection by delegating toPrimitiveIterable.makeString(String, String, String)and defaulting the start and end parameters to""(the empty String).- Specified by:
makeStringin interfacePrimitiveIterable- Returns:
- a string representation of this collection.
-
makeString
Description copied from interface:PrimitiveIterableReturns a string representation of this collection with the elements separated by the specified separator and enclosed between the start and end strings.- Specified by:
makeStringin interfacePrimitiveIterable- Returns:
- a string representation of this collection.
-
appendString
Description copied from interface:PrimitiveIterablePrints a string representation of this collection onto the givenAppendable. Prints the string returned byPrimitiveIterable.makeString().- Specified by:
appendStringin interfacePrimitiveIterable
-
appendString
Description copied from interface:PrimitiveIterablePrints a string representation of this collection onto the givenAppendable. Prints the string returned byPrimitiveIterable.makeString(String).- Specified by:
appendStringin interfacePrimitiveIterable
-
appendString
Description copied from interface:PrimitiveIterablePrints a string representation of this collection onto the givenAppendable. Prints the string returned byPrimitiveIterable.makeString(String, String, String).- Specified by:
appendStringin interfacePrimitiveIterable
-
toList
Description copied from interface:ByteIterableConverts the ByteIterable to a new MutableByteList.- Specified by:
toListin interfaceByteIterable
-
toSet
Description copied from interface:ByteIterableConverts the ByteIterable to a new MutableByteSet.- Specified by:
toSetin interfaceByteIterable
-
toBag
Description copied from interface:ByteIterableConverts the ByteIterable to a new MutableByteBag.- Specified by:
toBagin interfaceByteIterable
-
equals
Description copied from interface:ByteStackFollows the same general contract asStackIterable.equals(Object). -
hashCode
public int hashCode()Description copied from interface:ByteStackFollows the same general contract asStackIterable.hashCode(). -
asLazy
Description copied from interface:ByteIterableReturns a LazyByteIterable adapter wrapping the source ByteIterable.- Specified by:
asLazyin interfaceByteIterable
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableByteStack
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableByteStack
-
toImmutable
- Specified by:
toImmutablein interfaceByteStack
-
newEmpty
Description copied from interface:MutableByteStackCreates a new empty mutable version of the same stack type.- Specified by:
newEmptyin interfaceMutableByteStack- Since:
- 9.2.
-
injectInto
public <T> T injectInto(T injectedValue, ObjectByteToObjectFunction<? super T, ? extends T> function) - Specified by:
injectIntoin interfaceByteIterable
-
chunk
Description copied from interface:ByteIterablePartitions elements in fixed size chunks.- Specified by:
chunkin interfaceByteIterable- Parameters:
size- the number of elements per chunk- Returns:
- A
RichIterablecontainingByteIterables of sizesize, except the last will be truncated if the elements don't divide evenly.
-
getFirst
public byte getFirst()- Specified by:
getFirstin interfaceOrderedByteIterable
-
indexOf
public int indexOf(byte value) - Specified by:
indexOfin interfaceOrderedByteIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectByteIntToObjectFunction<? super T, ? extends T> function) - Specified by:
injectIntoWithIndexin interfaceOrderedByteIterable
-
forEachWithIndex
- Specified by:
forEachWithIndexin interfaceOrderedByteIterable
-
collectWithIndex
Returns a new MutableStack using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndexin interfaceByteStack- Specified by:
collectWithIndexin interfaceMutableByteStack- Specified by:
collectWithIndexin interfaceOrderedByteIterable- Since:
- 9.1.
-
collectWithIndex
public <V,R extends Collection<V>> R collectWithIndex(ByteIntToObjectFunction<? extends V> function, R target) Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndexin interfaceOrderedByteIterable- Since:
- 9.1.
-