Lines Matching defs:limit

34  * buffer are its capacity, limit, and position: </p>
41 * <p> A buffer's <i>limit</i> is the index of the first element that should
42 * not be read or written. A buffer's limit is never negative and is never
47 * greater than its limit. </p>
63 * elements transferred. If the requested transfer exceeds the limit then a
71 * limit. </p>
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
100 * <i>limit</i> <tt>&lt;=</tt>
105 * undefined. The initial limit may be zero, or it may be some other value
113 * <p> In addition to methods for accessing the position, limit, and capacity
120 * channel-read or relative <i>put</i> operations: It sets the limit to the
124 * channel-write or relative <i>get</i> operations: It sets the limit to the
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.
161 * b.limit(42);</pre></blockquote>
166 * b.flip().position(23).limit(42);</pre></blockquote>
176 // Invariants: mark <= position <= limit <= capacity
179 private int limit;
186 // Creates a new buffer with the given mark, position, limit, and capacity,
193 limit(lim);
227 * and no larger than the current limit
235 if ((newPosition > limit) || (newPosition < 0))
243 * Returns this buffer's limit. </p>
245 * @return The limit of this buffer
247 public final int limit() {
248 return limit;
252 * Sets this buffer's limit. If the position is larger than the new limit
253 * then it is set to the new limit. If the mark is defined and larger than
254 * the new limit then it is discarded. </p>
257 * The new limit value; must be non-negative
265 public final Buffer limit(int newLimit) {
268 limit = newLimit;
269 if (position > limit) position = limit;
270 if (mark > limit) mark = -1;
304 * Clears this buffer. The position is set to zero, the limit is set to
322 limit = capacity;
328 * Flips this buffer. The limit is set to the current position and then
349 limit = position;
360 * operations, assuming that the limit has already been set
378 * limit. </p>
383 return limit - position;
388 * the limit. </p>
394 return position < limit;
484 * Checks the current position against the limit, throwing a {@link
485 * BufferUnderflowException} if it is not smaller than the limit, and then
491 if (position >= limit)
497 if (limit - position < nb)
505 * Checks the current position against the limit, throwing a {@link
506 * BufferOverflowException} if it is not smaller than the limit, and then
512 if (position >= limit)
518 if (limit - position < nb)
526 * Checks the given index against the limit, throwing an {@link
527 * IndexOutOfBoundsException} if it is not smaller than the limit
531 if ((i < 0) || (i >= limit))
537 if ((i < 0) || (nb > limit - i))
549 limit = 0;