Class FloatArrayStack
java.lang.Object
org.eclipse.collections.impl.stack.primitive.AbstractFloatStack
org.eclipse.collections.impl.stack.mutable.primitive.FloatArrayStack
- All Implemented Interfaces:
Externalizable
,Serializable
,FloatIterable
,OrderedFloatIterable
,PrimitiveIterable
,FloatStack
,MutableFloatStack
public class FloatArrayStack
extends AbstractFloatStack
implements MutableFloatStack, Externalizable
FloatArrayStack is similar to
ArrayStack
, and is memory-optimized for float primitives.
This file was automatically generated from template file primitiveArrayStack.stg.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
FloatArrayStack
(float... items) private
FloatArrayStack
(int size) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the Stack<V> MutableStack
<V> collect
(FloatToObjectFunction<? extends V> function) Returns a new collection with the results of applying the specified function on each element of the source collection.boolean
Follows the same general contract asStackIterable.equals(Object)
.protected FloatArrayList
int
hashCode()
Follows the same general contract asStackIterable.hashCode()
.newEmpty()
Creates a new empty FloatArrayStack.static FloatArrayStack
newStack
(FloatIterable items) static FloatArrayStack
newStackFromTopToBottom
(float... items) static FloatArrayStack
static FloatArrayStack
newStackWith
(float... items) float
pop()
Removes and returns the top element of the stack.pop
(int count) Removes and returns a FloatList of the number of elements specified by the count, beginning with the top of the stack.void
push
(float item) Adds an item to the top of the stack.void
reject
(FloatPredicate predicate) Returns a new FloatIterable with all of the elements in the FloatIterable that return false for the specified predicate.select
(FloatPredicate predicate) Returns a new FloatIterable with all of the elements in the FloatIterable that return true for the specified predicate.void
Methods inherited from class org.eclipse.collections.impl.stack.primitive.AbstractFloatStack
allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, average, checkEmptyStack, checkPositiveValueForCount, checkSizeLessThanCount, chunk, contains, containsAll, containsAll, count, detectIfNone, each, floatIterator, forEachWithIndex, getFirst, indexOf, injectInto, injectIntoWithIndex, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, peek, peek, peekAt, rangeCheck, size, sum, toArray, toArray, toBag, toList, toSet, toSortedArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.collections.api.FloatIterable
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, floatIterator, 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, toSortedListBy, toSortedListBy
Methods inherited from interface org.eclipse.collections.api.stack.primitive.FloatStack
peek, peek, peekAt
Methods inherited from interface org.eclipse.collections.api.stack.primitive.MutableFloatStack
collectWithIndex, rejectWithIndex, selectWithIndex, tap
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedFloatIterable
collectWithIndex, forEachWithIndex, getFirst, indexOf, injectIntoWithIndex, rejectWithIndex, selectWithIndex
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
delegate
-
-
Constructor Details
-
FloatArrayStack
public FloatArrayStack() -
FloatArrayStack
private FloatArrayStack(int size) -
FloatArrayStack
private FloatArrayStack(float... items)
-
-
Method Details
-
newStackFromTopToBottom
-
newStackWith
-
newStack
-
newStackFromTopToBottom
-
getDelegate
- Specified by:
getDelegate
in classAbstractFloatStack
-
push
public void push(float item) Description copied from interface:MutableFloatStack
Adds an item to the top of the stack.- Specified by:
push
in interfaceMutableFloatStack
-
pop
public float pop()Description copied from interface:MutableFloatStack
Removes and returns the top element of the stack.- Specified by:
pop
in interfaceMutableFloatStack
-
pop
Description copied from interface:MutableFloatStack
Removes and returns a FloatList of the number of elements specified by the count, beginning with the top of the stack.- Specified by:
pop
in interfaceMutableFloatStack
-
select
Description copied from interface:FloatIterable
Returns a new FloatIterable with all of the elements in the FloatIterable that return true for the specified predicate.- Specified by:
select
in interfaceFloatIterable
- Specified by:
select
in interfaceFloatStack
- Specified by:
select
in interfaceMutableFloatStack
- Specified by:
select
in interfaceOrderedFloatIterable
-
reject
Description copied from interface:FloatIterable
Returns a new FloatIterable with all of the elements in the FloatIterable that return false for the specified predicate.- Specified by:
reject
in interfaceFloatIterable
- Specified by:
reject
in interfaceFloatStack
- Specified by:
reject
in interfaceMutableFloatStack
- Specified by:
reject
in interfaceOrderedFloatIterable
-
collect
Description copied from interface:FloatIterable
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 interfaceFloatIterable
- Specified by:
collect
in interfaceFloatStack
- Specified by:
collect
in interfaceMutableFloatStack
- Specified by:
collect
in interfaceOrderedFloatIterable
-
clear
public void clear()Description copied from interface:MutableFloatStack
Clears the Stack- Specified by:
clear
in interfaceMutableFloatStack
-
toSortedList
- Specified by:
toSortedList
in interfaceFloatIterable
-
asUnmodifiable
- Specified by:
asUnmodifiable
in interfaceMutableFloatStack
-
asSynchronized
- Specified by:
asSynchronized
in interfaceMutableFloatStack
-
toImmutable
- Specified by:
toImmutable
in interfaceFloatStack
-
newEmpty
Creates a new empty FloatArrayStack.- Specified by:
newEmpty
in interfaceMutableFloatStack
- Since:
- 9.2.
-
equals
Description copied from interface:FloatStack
Follows the same general contract asStackIterable.equals(Object)
.- Specified by:
equals
in interfaceFloatStack
- Overrides:
equals
in classAbstractFloatStack
-
hashCode
public int hashCode()Description copied from interface:FloatStack
Follows the same general contract asStackIterable.hashCode()
.- Specified by:
hashCode
in interfaceFloatStack
- Overrides:
hashCode
in classAbstractFloatStack
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
-