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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
allSatisfy
(BytePredicate predicate) Returns true if all of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.boolean
anySatisfy
(BytePredicate predicate) Returns true if any of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.void
appendString
(Appendable appendable) Prints a string representation of this collection onto the givenAppendable
.void
appendString
(Appendable appendable, String separator) Prints a string representation of this collection onto the givenAppendable
.void
appendString
(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.double
average()
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.void
clear()
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.boolean
contains
(byte value) Returns true if the value is contained in the ByteIterable, and false if it is not.boolean
containsAll
(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.boolean
containsAll
(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.int
count
(BytePredicate predicate) Returns a count of the number of elements in the ByteIterable that return true for the specified predicate.byte
detectIfNone
(BytePredicate predicate, byte ifNone) void
each
(ByteProcedure procedure) A synonym for forEach.boolean
Follows the same general contract asStackIterable.equals(Object)
.void
forEachWithIndex
(ByteIntProcedure procedure) byte
getFirst()
int
hashCode()
Follows the same general contract asStackIterable.hashCode()
.int
indexOf
(byte value) <T> T
injectInto
(T injectedValue, ObjectByteToObjectFunction<? super T, ? extends T> function) <T> T
injectIntoWithIndex
(T injectedValue, ObjectByteIntToObjectFunction<? super T, ? extends T> function) boolean
isEmpty()
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.byte
max()
byte
maxIfEmpty
(byte defaultValue) double
median()
byte
min()
byte
minIfEmpty
(byte defaultValue) newEmpty()
Creates a new empty mutable version of the same stack type.boolean
noneSatisfy
(BytePredicate predicate) Returns true if none of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.boolean
notEmpty()
The English equivalent of !this.isEmpty()byte
peek()
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.byte
peekAt
(int index) Returns the element at the specified index.byte
pop()
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.void
push
(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.int
size()
Returns the number of items in this iterable.long
sum()
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, toSortedListBy
Methods inherited from interface org.eclipse.collections.api.stack.primitive.MutableByteStack
rejectWithIndex, selectWithIndex, tap
Methods 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:MutableByteStack
Adds an item to the top of the stack.- Specified by:
push
in interfaceMutableByteStack
-
pop
public byte pop()Description copied from interface:MutableByteStack
Removes and returns the top element of the stack.- Specified by:
pop
in interfaceMutableByteStack
-
pop
Description copied from interface:MutableByteStack
Removes and returns a ByteList of the number of elements specified by the count, beginning with the top of the stack.- Specified by:
pop
in interfaceMutableByteStack
-
peek
public byte peek()Description copied from interface:ByteStack
Returns the top of the stack. -
peek
Description copied from interface:ByteStack
Returns 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:ByteStack
Returns the element at the specified index. -
size
public int size()Description copied from interface:PrimitiveIterable
Returns the number of items in this iterable.- Specified by:
size
in interfacePrimitiveIterable
-
isEmpty
public boolean isEmpty()Description copied from interface:PrimitiveIterable
Returns true if this iterable has zero items.- Specified by:
isEmpty
in interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()Description copied from interface:PrimitiveIterable
The English equivalent of !this.isEmpty()- Specified by:
notEmpty
in interfacePrimitiveIterable
-
clear
public void clear()Description copied from interface:MutableByteStack
Clears the Stack- Specified by:
clear
in interfaceMutableByteStack
-
contains
public boolean contains(byte value) Description copied from interface:ByteIterable
Returns true if the value is contained in the ByteIterable, and false if it is not.- Specified by:
contains
in interfaceByteIterable
-
containsAll
public boolean containsAll(byte... source) Description copied from interface:ByteIterable
Returns true if all of the values specified in the source array are contained in the ByteIterable, and false if they are not.- Specified by:
containsAll
in interfaceByteIterable
-
containsAll
Description copied from interface:ByteIterable
Returns true if all of the values specified in the source ByteIterable are contained in the ByteIterable, and false if they are not.- Specified by:
containsAll
in interfaceByteIterable
-
byteIterator
Description copied from interface:ByteIterable
Returns a primitive iterator that can be used to iterate over the ByteIterable in an imperative style.- Specified by:
byteIterator
in interfaceByteIterable
-
each
Description copied from interface:ByteIterable
A synonym for forEach.- Specified by:
each
in interfaceByteIterable
- Since:
- 7.0.
-
count
Description copied from interface:ByteIterable
Returns a count of the number of elements in the ByteIterable that return true for the specified predicate.- Specified by:
count
in interfaceByteIterable
-
anySatisfy
Description copied from interface:ByteIterable
Returns true if any of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.- Specified by:
anySatisfy
in interfaceByteIterable
-
allSatisfy
Description copied from interface:ByteIterable
Returns true if all of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.- Specified by:
allSatisfy
in interfaceByteIterable
-
noneSatisfy
Description copied from interface:ByteIterable
Returns true if none of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.- Specified by:
noneSatisfy
in interfaceByteIterable
-
detectIfNone
- Specified by:
detectIfNone
in interfaceByteIterable
-
select
Description copied from interface:ByteIterable
Returns a new ByteIterable with all of the elements in the ByteIterable that return true for the specified predicate.- Specified by:
select
in interfaceByteIterable
- Specified by:
select
in interfaceByteStack
- Specified by:
select
in interfaceMutableByteStack
- Specified by:
select
in interfaceOrderedByteIterable
-
reject
Description copied from interface:ByteIterable
Returns a new ByteIterable with all of the elements in the ByteIterable that return false for the specified predicate.- Specified by:
reject
in interfaceByteIterable
- Specified by:
reject
in interfaceByteStack
- Specified by:
reject
in interfaceMutableByteStack
- Specified by:
reject
in interfaceOrderedByteIterable
-
collect
Description copied from interface:ByteIterable
Returns 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:
collect
in interfaceByteIterable
- Specified by:
collect
in interfaceByteStack
- Specified by:
collect
in interfaceMutableByteStack
- Specified by:
collect
in interfaceOrderedByteIterable
-
sum
public long sum()- Specified by:
sum
in interfaceByteIterable
-
max
public byte max()- Specified by:
max
in interfaceByteIterable
-
min
public byte min()- Specified by:
min
in interfaceByteIterable
-
minIfEmpty
public byte minIfEmpty(byte defaultValue) - Specified by:
minIfEmpty
in interfaceByteIterable
-
maxIfEmpty
public byte maxIfEmpty(byte defaultValue) - Specified by:
maxIfEmpty
in interfaceByteIterable
-
average
public double average()- Specified by:
average
in interfaceByteIterable
-
median
public double median()- Specified by:
median
in interfaceByteIterable
-
toSortedList
- Specified by:
toSortedList
in interfaceByteIterable
-
toSortedArray
public byte[] toSortedArray()- Specified by:
toSortedArray
in interfaceByteIterable
-
toArray
public byte[] toArray()Description copied from interface:ByteIterable
Converts the ByteIterable to a primitive byte array.- Specified by:
toArray
in interfaceByteIterable
-
toArray
public byte[] toArray(byte[] target) Description copied from interface:ByteIterable
Converts 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:
toArray
in interfaceByteIterable
-
toString
Description copied from interface:PrimitiveIterable
Returns 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:
toString
in interfacePrimitiveIterable
- Overrides:
toString
in classObject
- Returns:
- a string representation of this PrimitiveIterable
- See Also:
-
makeString
Description copied from interface:PrimitiveIterable
Returns a string representation of this collection by delegating toPrimitiveIterable.makeString(String)
and defaulting the separator parameter to the characters", "
(comma and space).- Specified by:
makeString
in interfacePrimitiveIterable
- Returns:
- a string representation of this collection.
-
makeString
Description copied from interface:PrimitiveIterable
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).- Specified by:
makeString
in interfacePrimitiveIterable
- Returns:
- a string representation of this collection.
-
makeString
Description copied from interface:PrimitiveIterable
Returns a string representation of this collection with the elements separated by the specified separator and enclosed between the start and end strings.- Specified by:
makeString
in interfacePrimitiveIterable
- Returns:
- a string representation of this collection.
-
appendString
Description copied from interface:PrimitiveIterable
Prints a string representation of this collection onto the givenAppendable
. Prints the string returned byPrimitiveIterable.makeString()
.- Specified by:
appendString
in interfacePrimitiveIterable
-
appendString
Description copied from interface:PrimitiveIterable
Prints a string representation of this collection onto the givenAppendable
. Prints the string returned byPrimitiveIterable.makeString(String)
.- Specified by:
appendString
in interfacePrimitiveIterable
-
appendString
Description copied from interface:PrimitiveIterable
Prints a string representation of this collection onto the givenAppendable
. Prints the string returned byPrimitiveIterable.makeString(String, String, String)
.- Specified by:
appendString
in interfacePrimitiveIterable
-
toList
Description copied from interface:ByteIterable
Converts the ByteIterable to a new MutableByteList.- Specified by:
toList
in interfaceByteIterable
-
toSet
Description copied from interface:ByteIterable
Converts the ByteIterable to a new MutableByteSet.- Specified by:
toSet
in interfaceByteIterable
-
toBag
Description copied from interface:ByteIterable
Converts the ByteIterable to a new MutableByteBag.- Specified by:
toBag
in interfaceByteIterable
-
equals
Description copied from interface:ByteStack
Follows the same general contract asStackIterable.equals(Object)
. -
hashCode
public int hashCode()Description copied from interface:ByteStack
Follows the same general contract asStackIterable.hashCode()
. -
asLazy
Description copied from interface:ByteIterable
Returns a LazyByteIterable adapter wrapping the source ByteIterable.- Specified by:
asLazy
in interfaceByteIterable
-
asUnmodifiable
- Specified by:
asUnmodifiable
in interfaceMutableByteStack
-
asSynchronized
- Specified by:
asSynchronized
in interfaceMutableByteStack
-
toImmutable
- Specified by:
toImmutable
in interfaceByteStack
-
newEmpty
Description copied from interface:MutableByteStack
Creates a new empty mutable version of the same stack type.- Specified by:
newEmpty
in interfaceMutableByteStack
- Since:
- 9.2.
-
injectInto
public <T> T injectInto(T injectedValue, ObjectByteToObjectFunction<? super T, ? extends T> function) - Specified by:
injectInto
in interfaceByteIterable
-
chunk
Description copied from interface:ByteIterable
Partitions elements in fixed size chunks.- Specified by:
chunk
in interfaceByteIterable
- Parameters:
size
- the number of elements per chunk- Returns:
- A
RichIterable
containingByteIterable
s of sizesize
, except the last will be truncated if the elements don't divide evenly.
-
getFirst
public byte getFirst()- Specified by:
getFirst
in interfaceOrderedByteIterable
-
indexOf
public int indexOf(byte value) - Specified by:
indexOf
in interfaceOrderedByteIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectByteIntToObjectFunction<? super T, ? extends T> function) - Specified by:
injectIntoWithIndex
in interfaceOrderedByteIterable
-
forEachWithIndex
- Specified by:
forEachWithIndex
in interfaceOrderedByteIterable
-
collectWithIndex
Returns a new MutableStack using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndex
in interfaceByteStack
- Specified by:
collectWithIndex
in interfaceMutableByteStack
- Specified by:
collectWithIndex
in 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:
collectWithIndex
in interfaceOrderedByteIterable
- Since:
- 9.1.
-