Lines Matching refs:position

34  * buffer are its capacity, limit, and position: </p>
45 * <p> A buffer's <i>position</i> is the index of the next element to be
46 * read or written. A buffer's position is never negative and is never
62 * at the current position and then increment the position by the number of
69 * affect the position. Absolute <i>get</i> and <i>put</i> operations throw
77 * current position.
82 * <p> A buffer's <i>mark</i> is the index to which its position will be reset
85 * than the position. If the mark is defined then it is discarded when the
86 * position or the limit is adjusted to a value smaller than the mark. If the
93 * <p> The following invariant holds for the mark, position, limit, and
99 * <i>position</i> <tt>&lt;=</tt>
104 * <p> A newly-created buffer always has a position of zero and a mark that is
113 * <p> In addition to methods for accessing the position, limit, and capacity
121 * capacity and the position to zero. </p></li>
125 * current position and then sets the position to zero. </p></li>
128 * it already contains: It leaves the limit unchanged and sets the position
140 * content to be changed, but its mark, position, and limit values are mutable.
160 * b.position(23);
166 * b.flip().position(23).limit(42);</pre></blockquote>
176 // Invariants: mark <= position <= limit <= capacity
178 private int position = 0;
186 // Creates a new buffer with the given mark, position, limit, and capacity,
194 position(pos);
197 throw new IllegalArgumentException("mark > position: ("
213 * Returns this buffer's position. </p>
215 * @return The position of this buffer
217 public final int position() {
218 return position;
222 * Sets this buffer's position. If the mark is defined and larger than the
223 * new position then it is discarded. </p>
226 * The new position value; must be non-negative
234 public final Buffer position(int newPosition) {
237 position = newPosition;
238 if (mark > position) mark = -1;
252 * Sets this buffer's limit. If the position is larger than the new limit
269 if (position > limit) position = limit;
275 * Sets this buffer's mark at its position. </p>
280 mark = position;
285 * Resets this buffer's position to the previously-marked position.
299 position = m;
304 * Clears this buffer. The position is set to zero, the limit is set to
321 position = 0;
328 * Flips this buffer. The limit is set to the current position and then
329 * the position is set to zero. If the mark is defined then it is
349 limit = position;
350 position = 0;
356 * Rewinds this buffer. The position is set to zero and the mark is
371 position = 0;
377 * Returns the number of elements between the current position and the
383 return limit - position;
387 * Tells whether there are any elements between the current position and
394 return position < limit;
450 * <p> If this buffer is backed by an array then buffer position <i>p</i>
484 * Checks the current position against the limit, throwing a {@link
486 * increments the position. </p>
488 * @return The current position value, before it is incremented
491 if (position >= limit)
493 return position++;
497 if (limit - position < nb)
499 int p = position;
500 position += nb;
505 * Checks the current position against the limit, throwing a {@link
507 * increments the position. </p>
509 * @return The current position value, before it is incremented
512 if (position >= limit)
514 return position++;
518 if (limit - position < nb)
520 int p = position;
521 position += nb;
548 position = 0;