Package com.jogamp.common.util
Interface PrimitiveStack
-
- All Known Implementing Classes:
FloatStack,IntegerStack
public interface PrimitiveStackSimple primitive-type stack.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcapacity()Returns this stack's current capacity.intgetGrowSize()Returns the grow size.intposition()Returns the current position of this stack.voidposition(int newPosition)Sets the position of this stack.intremaining()Returns the remaining elements left before stack will grow aboutgetGrowSize().voidsetGrowSize(int newGrowSize)Set new {@link #growSize().
-
-
-
Method Detail
-
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
void position(int newPosition) throws IndexOutOfBoundsExceptionSets 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:
capacity(),position()
-
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().
-
-