|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jogamp.common.util.IntegerStack
public class IntegerStack
Simple primitive-type stack.
Implemented operations:
Constructor Summary | |
---|---|
IntegerStack(int initialSize,
int growSize)
|
Method Summary | |
---|---|
int[] |
buffer()
|
int |
capacity()
Returns this stack's current capacity. |
int[] |
getFromTop(int[] dest,
int destOffset,
int length)
FILO get operation |
IntBuffer |
getFromTop(IntBuffer dest,
int length)
FILO get operation |
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[] |
putOnTop(int[] src,
int srcOffset,
int length)
FILO put operation |
IntBuffer |
putOnTop(IntBuffer src,
int length)
FILO put operation |
int |
remaining()
Returns the remaining elements left before stack will grow about PrimitiveStack.getGrowSize() . |
void |
setGrowSize(int newGrowSize)
Set new {@link #growSize(). |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IntegerStack(int initialSize, int growSize)
initialSize
- initial size, must be > zerogrowSize
- grow size if position()
is reached, maybe 0
in which case an IndexOutOfBoundsException
is thrown.Method Detail |
---|
public final int capacity()
PrimitiveStack
The capacity may grow with a put operation w/ insufficient PrimitiveStack.remaining()
elements left, if PrimitiveStack.getGrowSize()
> 0.
capacity
in interface PrimitiveStack
public final int position()
PrimitiveStack
Position is in the range: 0 ≤ position < PrimitiveStack.capacity()
.
The position equals to the number of elements stored.
position
in interface PrimitiveStack
public final void position(int newPosition) throws IndexOutOfBoundsException
PrimitiveStack
position
in interface PrimitiveStack
newPosition
- the new position
IndexOutOfBoundsException
- if newPosition
is outside of range: 0 ≤ position < PrimitiveStack.capacity()
.public final int remaining()
PrimitiveStack
PrimitiveStack.getGrowSize()
.
remaining := capacity() - position();
0 denotes a full stack.
remaining
in interface PrimitiveStack
PrimitiveStack.capacity()
,
PrimitiveStack.position()
public final int getGrowSize()
PrimitiveStack
PrimitiveStack.capacity()
.
getGrowSize
in interface PrimitiveStack
public final void setGrowSize(int newGrowSize)
PrimitiveStack
setGrowSize
in interface PrimitiveStack
public final String toString()
toString
in class Object
public final int[] buffer()
public final int[] putOnTop(int[] src, int srcOffset, int length) throws IndexOutOfBoundsException
src
- source buffersrcOffset
- offset of srclength
- number of float elements to put from src
on-top this stack
IndexOutOfBoundsException
- if stack cannot grow due to zero grow-size or offset+length exceeds src.public final IntBuffer putOnTop(IntBuffer src, int length) throws IndexOutOfBoundsException, BufferUnderflowException
src
- source buffer, it's position is incremented by length
length
- number of float elements to put from src
on-top this stack
IndexOutOfBoundsException
- if stack cannot grow due to zero grow-size
BufferUnderflowException
- if src
FloatBuffer has less remaining elements than length
.public final int[] getFromTop(int[] dest, int destOffset, int length) throws IndexOutOfBoundsException
dest
- destination bufferdestOffset
- offset of destlength
- number of float elements to get from-top this stack to dest
.
IndexOutOfBoundsException
- if stack or dest
has less elements than length
.public final IntBuffer getFromTop(IntBuffer dest, int length) throws IndexOutOfBoundsException, BufferOverflowException
dest
- destination buffer, it's position is incremented by length
.length
- number of float elements to get from-top this stack to dest
.
IndexOutOfBoundsException
- if stack has less elements than length
BufferOverflowException
- if src
FloatBuffer has less remaining elements than length
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |