Package com.jogamp.common.util
Interface PrimitiveStack
-
- All Known Implementing Classes:
FloatStack
,IntegerStack
public interface PrimitiveStack
Simple primitive-type stack.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
capacity()
Returns this stack's current capacity.int
getGrowSize()
Returns the grow size.int
position()
Returns the current position of this stack.void
position(int newPosition)
Sets the position of this stack.int
remaining()
Returns the remaining elements left before stack will grow aboutgetGrowSize()
.void
setGrowSize(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 IndexOutOfBoundsException
Sets the position of this stack.- Parameters:
newPosition
- the new position- Throws:
IndexOutOfBoundsException
- ifnewPosition
is 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().
-
-