summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/util/PrimitiveStack.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-12-31 14:52:36 +0100
committerSven Gothel <[email protected]>2012-12-31 14:52:36 +0100
commit8b3e5b94bcd3167278eb972b2be37086d3bd2996 (patch)
treec09970a1990e3bb7bb676f275c0a51af63df3cb6 /src/java/com/jogamp/common/util/PrimitiveStack.java
parentac16df0bab94fab313030ead42644844d1690a82 (diff)
PrimitiveStack: Add 'void position(int)' to set new position. Add test case w/ initialSizeElem:=0.
Diffstat (limited to 'src/java/com/jogamp/common/util/PrimitiveStack.java')
-rw-r--r--src/java/com/jogamp/common/util/PrimitiveStack.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/java/com/jogamp/common/util/PrimitiveStack.java b/src/java/com/jogamp/common/util/PrimitiveStack.java
index 23447e3..89ae72e 100644
--- a/src/java/com/jogamp/common/util/PrimitiveStack.java
+++ b/src/java/com/jogamp/common/util/PrimitiveStack.java
@@ -41,16 +41,24 @@ public interface PrimitiveStack {
int capacity();
/**
- * Returns the current position where the next put operation will store the next element.
+ * Returns the current position of this stack.
* <p>
- * The position equals to the number of elements already stored.
+ * Position is in the range: 0 &le; position &lt; {@link #capacity()}.
* </p>
- * <p>
- * 0 denotes an empty stack.
+ * <p>
+ * The position equals to the number of elements stored.
* </p>
**/
int position();
+ /**
+ * Sets the position of this stack.
+ *
+ * @param newPosition the new position
+ * @throws IndexOutOfBoundsException if <code>newPosition</code> is outside of range: 0 &le; position &lt; {@link #capacity()}.
+ */
+ void position(int newPosition) throws IndexOutOfBoundsException;
+
/**
* Returns the remaining elements left before stack will grow about {@link #getGrowSize()}.
* <pre>
@@ -68,5 +76,5 @@ public interface PrimitiveStack {
int getGrowSize();
/** Set new {@link #growSize(). */
- void setGrowSize(int newGrowSize);
+ void setGrowSize(int newGrowSize);
}