Top Description Methods
com.jogamp.common.util

public Interface PrimitiveStack

Known Direct Implementers
com.jogamp.common.util.FloatStack, com.jogamp.common.util.IntegerStack

Simple primitive-type stack.

Method Summary

Modifier and TypeMethod and Description
public int
capacity()

Returns this stack's current capacity.

public int
getGrowSize()

Returns the grow size.

public int
position()

Returns the current position of this stack.

public void
position(int
the new position
newPosition
)

Sets the position of this stack.

public int
remaining()

Returns the remaining elements left before stack will grow about getGrowSize().

public void
setGrowSize(int newGrowSize)

Set new {@link #growSize().

Method Detail

capacityback to summary
public int capacity()

Returns this stack's current capacity.

The capacity may grow with a put operation w/ insufficient remaining() elements left, if getGrowSize() > 0.

getGrowSizeback to summary
public int getGrowSize()

Returns the grow size. A stack grows by this size in case a put operation exceeds it's capacity().

positionback to summary
public 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.

positionback to summary
public void position(int newPosition) throws IndexOutOfBoundsException

Sets the position of this stack.

Parameters
newPosition:int

the new position

Exceptions
IndexOutOfBoundsException:
if newPosition is outside of range: 0 ≤ position < capacity().
remainingback to summary
public int remaining()

Returns the remaining elements left before stack will grow about getGrowSize().

  remaining := capacity() - position();

0 denotes a full stack.

See Also
capacity(), position()
setGrowSizeback to summary
public void setGrowSize(int newGrowSize)

Set new {@link #growSize().