Package com.jogamp.common.util
Interface PrimitiveStack
- All Known Implementing Classes:
FloatStack,IntegerStack
public interface PrimitiveStack
Simple primitive-type stack.
-
Method Summary
Modifier and TypeMethodDescriptionintcapacity()Returns this stack's current capacity.intReturns the grow size.intposition()Returns the current position of this stack.voidposition(int newPosition) Sets the position of this stack.intReturns the remaining elements left before stack will grow aboutgetGrowSize().voidsetGrowSize(int newGrowSize) Set new {@link #growSize().
-
Method Details
-
capacity
int capacity()Returns this stack's current capacity.The capacity may grow with a put operation w/ insufficient
remaining()elements left, ifgetGrowSize()> 0. -
position
int position()Returns the current position of this stack.Position is in the range: 0 ≤ position <
capacity().The position equals to the number of elements stored.
-
position
Sets the position of this stack.- Parameters:
newPosition- the new position- Throws:
IndexOutOfBoundsException- ifnewPositionis outside of range: 0 ≤ position <capacity().
-
remaining
int remaining()Returns the remaining elements left before stack will grow aboutgetGrowSize().remaining := capacity() - position();
0 denotes a full stack.
- See Also:
-
getGrowSize
int getGrowSize()Returns the grow size. A stack grows by this size in case a put operation exceeds it'scapacity(). -
setGrowSize
void setGrowSize(int newGrowSize) Set new {@link #growSize().
-