GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
com.jogamp.common.util.IntegerStack Class Reference

Simple primitive-type stack. More...

Inheritance diagram for com.jogamp.common.util.IntegerStack:
Collaboration diagram for com.jogamp.common.util.IntegerStack:

Public Member Functions

 IntegerStack (final int initialSize, final int growSize)
 
final int capacity ()
 Returns this stack's current capacity. More...
 
final int position ()
 Returns the current position of this stack. More...
 
final void position (final int newPosition) throws IndexOutOfBoundsException
 Sets the position of this stack. More...
 
final int remaining ()
 Returns the remaining elements left before stack will grow about getGrowSize(). More...
 
final int getGrowSize ()
 Returns the grow size. More...
 
final void setGrowSize (final int newGrowSize)
 Set new growSize(). More...
 
final String toString ()
 
final int[] buffer ()
 
final int[] putOnTop (final int[] src, final int srcOffset, final int length) throws IndexOutOfBoundsException
 FILO put operation. More...
 
final IntBuffer putOnTop (final IntBuffer src, final int length) throws IndexOutOfBoundsException, BufferUnderflowException
 FILO put operation. More...
 
final int[] getFromTop (final int[] dest, final int destOffset, final int length) throws IndexOutOfBoundsException
 FILO get operation. More...
 
final IntBuffer getFromTop (final IntBuffer dest, final int length) throws IndexOutOfBoundsException, BufferOverflowException
 FILO get operation. More...
 
int capacity ()
 Returns this stack's current capacity. More...
 
int position ()
 Returns the current position of this stack. More...
 
void position (int newPosition) throws IndexOutOfBoundsException
 Sets the position of this stack. More...
 
int remaining ()
 Returns the remaining elements left before stack will grow about getGrowSize(). More...
 
int getGrowSize ()
 Returns the grow size. More...
 
void setGrowSize (int newGrowSize)
 Set new growSize(). More...
 

Detailed Description

Simple primitive-type stack.

Implemented operations:

  • FILO - First In, Last Out

Definition at line 43 of file IntegerStack.java.

Constructor & Destructor Documentation

◆ IntegerStack()

com.jogamp.common.util.IntegerStack.IntegerStack ( final int  initialSize,
final int  growSize 
)
Parameters
initialSizeinitial size, must be > zero
growSizegrow size if position() is reached, maybe 0 in which case an IndexOutOfBoundsException is thrown.

Definition at line 53 of file IntegerStack.java.

Member Function Documentation

◆ buffer()

final int[] com.jogamp.common.util.IntegerStack.buffer ( )

Definition at line 87 of file IntegerStack.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ capacity()

final int com.jogamp.common.util.IntegerStack.capacity ( )

Returns this stack's current capacity.

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

Implements com.jogamp.common.util.PrimitiveStack.

Definition at line 60 of file IntegerStack.java.

◆ getFromTop() [1/2]

final int[] com.jogamp.common.util.IntegerStack.getFromTop ( final int[]  dest,
final int  destOffset,
final int  length 
) throws IndexOutOfBoundsException

FILO get operation.

Parameters
destdestination buffer
destOffsetoffset of dest
lengthnumber of float elements to get from-top this stack to dest.
Returns
the dest float[]
Exceptions
IndexOutOfBoundsExceptionif stack or dest has less elements than length.

Definition at line 145 of file IntegerStack.java.

◆ getFromTop() [2/2]

final IntBuffer com.jogamp.common.util.IntegerStack.getFromTop ( final IntBuffer  dest,
final int  length 
) throws IndexOutOfBoundsException, BufferOverflowException

FILO get operation.

Parameters
destdestination buffer, it's position is incremented by length.
lengthnumber of float elements to get from-top this stack to dest.
Returns
the dest FloatBuffer
Exceptions
IndexOutOfBoundsExceptionif stack has less elements than length
BufferOverflowExceptionif src FloatBuffer has less remaining elements than length.

Definition at line 161 of file IntegerStack.java.

◆ getGrowSize()

final int com.jogamp.common.util.IntegerStack.getGrowSize ( )

Returns the grow size.

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

Implements com.jogamp.common.util.PrimitiveStack.

Definition at line 77 of file IntegerStack.java.

◆ position() [1/2]

final int com.jogamp.common.util.IntegerStack.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.

Implements com.jogamp.common.util.PrimitiveStack.

Definition at line 63 of file IntegerStack.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ position() [2/2]

final void com.jogamp.common.util.IntegerStack.position ( final int  newPosition) throws IndexOutOfBoundsException

Sets the position of this stack.

Parameters
newPositionthe new position
Exceptions
IndexOutOfBoundsExceptionif newPosition is outside of range: 0 ≤ position < capacity().

Implements com.jogamp.common.util.PrimitiveStack.

Definition at line 66 of file IntegerStack.java.

Here is the call graph for this function:

◆ putOnTop() [1/2]

final int[] com.jogamp.common.util.IntegerStack.putOnTop ( final int[]  src,
final int  srcOffset,
final int  length 
) throws IndexOutOfBoundsException

FILO put operation.

Parameters
srcsource buffer
srcOffsetoffset of src
lengthnumber of float elements to put from src on-top this stack
Returns
the src float[]
Exceptions
IndexOutOfBoundsExceptionif stack cannot grow due to zero grow-size or offset+length exceeds src.

Definition at line 111 of file IntegerStack.java.

◆ putOnTop() [2/2]

final IntBuffer com.jogamp.common.util.IntegerStack.putOnTop ( final IntBuffer  src,
final int  length 
) throws IndexOutOfBoundsException, BufferUnderflowException

FILO put operation.

Parameters
srcsource buffer, it's position is incremented by length
lengthnumber of float elements to put from src on-top this stack
Returns
the src FloatBuffer
Exceptions
IndexOutOfBoundsExceptionif stack cannot grow due to zero grow-size
BufferUnderflowExceptionif src FloatBuffer has less remaining elements than length.

Definition at line 128 of file IntegerStack.java.

◆ remaining()

final int com.jogamp.common.util.IntegerStack.remaining ( )

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

  remaining := capacity() - position();

<p<blockquote>‍

0 denotes a full stack.

See also
capacity()
#position()

Implements com.jogamp.common.util.PrimitiveStack.

Definition at line 74 of file IntegerStack.java.

Here is the caller graph for this function:

◆ setGrowSize()

final void com.jogamp.common.util.IntegerStack.setGrowSize ( final int  newGrowSize)

Set new growSize().

Implements com.jogamp.common.util.PrimitiveStack.

Definition at line 80 of file IntegerStack.java.

◆ toString()

final String com.jogamp.common.util.IntegerStack.toString ( )

Definition at line 83 of file IntegerStack.java.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: