Home
last modified time | relevance | path

Searched refs:limit (Results 1 – 25 of 157) sorted by relevance

1234567

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
DAbstractBufferTest.java42 assertTrue(0 <= baseBuf.position() && baseBuf.position() <= baseBuf.limit() in testCapacity()
43 && baseBuf.limit() <= baseBuf.capacity()); in testCapacity()
49 int oldLimit = baseBuf.limit(); in testClear()
54 assertEquals(baseBuf.limit(), baseBuf.capacity()); in testClear()
63 baseBuf.limit(oldLimit); in testClear()
70 int oldLimit = baseBuf.limit(); in testFlip()
75 assertEquals(baseBuf.limit(), oldPosition); in testFlip()
84 baseBuf.limit(oldLimit); in testFlip()
91 int oldLimit = baseBuf.limit(); in testHasRemaining()
93 assertEquals(baseBuf.hasRemaining(), baseBuf.position() < baseBuf.limit()); in testHasRemaining()
[all …]
DLongBufferTest.java87 buf.position(buf.limit()); in testAsReadOnlyBuffer()
94 assertEquals(buf.limit(), readonly.limit()); in testAsReadOnlyBuffer()
103 assertEquals(buf.position(), buf.limit()); in testAsReadOnlyBuffer()
116 assertEquals(buf.limit(), buf.capacity()); in testCompact()
127 buf.limit(0); in testCompact()
132 assertEquals(buf.limit(), buf.capacity()); in testCompact()
144 buf.limit(5); in testCompact()
149 assertEquals(buf.limit(), buf.capacity()); in testCompact()
177 other.limit(5); in testCompareTo()
185 buf.position(buf.limit());
[all …]
DFloatBufferTest.java87 buf.position(buf.limit()); in testAsReadOnlyBuffer()
94 assertEquals(buf.limit(), readonly.limit()); in testAsReadOnlyBuffer()
103 assertEquals(buf.position(), buf.limit()); in testAsReadOnlyBuffer()
117 assertEquals(buf.limit(), buf.capacity()); in testCompact()
128 buf.limit(0); in testCompact()
133 assertEquals(buf.limit(), buf.capacity()); in testCompact()
145 buf.limit(5); in testCompact()
150 assertEquals(buf.limit(), buf.capacity()); in testCompact()
185 other.limit(5); in testCompareTo()
205 buf.position(buf.limit());
[all …]
DShortBufferTest.java86 buf.position(buf.limit()); in testAsReadOnlyBuffer()
93 assertEquals(buf.limit(), readonly.limit()); in testAsReadOnlyBuffer()
102 assertEquals(buf.position(), buf.limit()); in testAsReadOnlyBuffer()
115 assertEquals(buf.limit(), buf.capacity()); in testCompact()
126 buf.limit(0); in testCompact()
131 assertEquals(buf.limit(), buf.capacity()); in testCompact()
143 buf.limit(5); in testCompact()
148 assertEquals(buf.limit(), buf.capacity()); in testCompact()
176 other.limit(5); in testCompareTo()
184 buf.position(buf.limit());
[all …]
DIntBufferTest.java87 buf.position(buf.limit()); in testAsReadOnlyBuffer()
94 assertEquals(buf.limit(), readonly.limit()); in testAsReadOnlyBuffer()
103 assertEquals(buf.position(), buf.limit()); in testAsReadOnlyBuffer()
116 assertEquals(buf.limit(), buf.capacity()); in testCompact()
127 buf.limit(0); in testCompact()
132 assertEquals(buf.limit(), buf.capacity()); in testCompact()
144 buf.limit(5); in testCompact()
149 assertEquals(buf.limit(), buf.capacity()); in testCompact()
177 other.limit(5); in testCompareTo()
185 buf.position(buf.limit());
[all …]
DDoubleBufferTest.java111 buf.position(buf.limit()); in testAsReadOnlyBuffer()
118 assertEquals(buf.limit(), readonly.limit()); in testAsReadOnlyBuffer()
127 assertEquals(buf.position(), buf.limit()); in testAsReadOnlyBuffer()
140 assertEquals(buf.limit(), buf.capacity()); in testCompact()
151 buf.limit(0); in testCompact()
156 assertEquals(buf.limit(), buf.capacity()); in testCompact()
168 buf.limit(5); in testCompact()
173 assertEquals(buf.limit(), buf.capacity()); in testCompact()
195 other.limit(5); in testCompareTo()
225 buf.position(buf.limit());
[all …]
DCharBufferTest.java90 buf.position(buf.limit()); in testAsReadOnlyBuffer()
97 assertEquals(buf.limit(), readonly.limit()); in testAsReadOnlyBuffer()
107 assertEquals(buf.position(), buf.limit()); in testAsReadOnlyBuffer()
112 int originalPosition = (buf.position() + buf.limit()) / 2; in testAsReadOnlyBuffer()
115 buf.position(buf.limit()); in testAsReadOnlyBuffer()
122 assertEquals(buf.limit(), readonly.limit()); in testAsReadOnlyBuffer()
132 assertEquals(buf.position(), buf.limit()); in testAsReadOnlyBuffer()
145 assertEquals(buf.limit(), buf.capacity()); in testCompact()
156 buf.limit(0); in testCompact()
161 assertEquals(buf.limit(), buf.capacity()); in testCompact()
[all …]
/libcore/ojluni/src/main/java/java/nio/
DBuffer.java189 private int limit; field in Buffer
213 limit(lim); in Buffer()
257 if ((newPosition > limit) || (newPosition < 0)) in position()
259 throw new IllegalArgumentException("Bad position " + newPosition + "/" + limit); in position()
270 public final int limit() { in limit() method in Buffer
271 return limit; in limit()
288 public Buffer limit(int newLimit) { in limit() method in Buffer
291 limit = newLimit; in limit()
292 if (position > limit) position = limit; in limit()
293 if (mark > limit) mark = -1; in limit()
[all …]
DCharBufferSpliterator.java42 private final int limit; field in CharBufferSpliterator
45 this(buffer, buffer.position(), buffer.limit()); in CharBufferSpliterator()
48 CharBufferSpliterator(CharBuffer buffer, int origin, int limit) { in CharBufferSpliterator() argument
49 assert origin <= limit; in CharBufferSpliterator()
51 this.index = (origin <= limit) ? origin : limit; in CharBufferSpliterator()
52 this.limit = limit; in CharBufferSpliterator()
57 int lo = index, mid = (lo + limit) >>> 1; in trySplit()
69 int hi = limit; in forEachRemaining()
80 if (index >= 0 && index < limit) { in tryAdvance()
89 return (long)(limit - index); in estimateSize()
DByteBufferAsCharBuffer.java59 int lim = this.limit(); in slice()
71 limit(), in duplicate()
81 limit(), in asReadOnlyBuffer()
139 int lim = limit(); in compact()
148 limit(capacity()); in compact()
162 if ((end > limit()) || (start > end)) in toString()
170 db.limit(end); in toString()
182 int lim = limit(); in subSequence()
DCharBuffer.java258 int limit = limit(); in read() local
261 limit(position() + n); in read()
266 limit(limit); // restore real limit in read()
875 public Buffer limit(int newLimit) { in limit() method in CharBuffer
876 return super.limit(newLimit); in limit()
961 for (int i = limit() - 1; i >= p; i--) in hashCode()
1007 for (int i = this.limit() - 1, j = that.limit() - 1; i >= p; i--, j--) in equals()
1074 return toString(position(), limit()); in toString()
DByteBufferAsFloatBuffer.java59 int lim = this.limit(); in slice()
71 limit(), in duplicate()
81 limit(), in asReadOnlyBuffer()
135 int lim = limit(); in compact()
144 limit(capacity()); in compact()
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DIntSliceOpTest.java83 assertCountSum(IntStream.range(0, 0).limit(4).boxed(), 0, 0); in testLimit()
84 assertCountSum(IntStream.range(1, 3).limit(4).boxed(), 2, 3); in testLimit()
85 assertCountSum(IntStream.range(1, 5).limit(4).boxed(), 4, 10); in testLimit()
86 assertCountSum(IntStream.range(1, 9).limit(4).boxed(), 4, 10); in testLimit()
88 assertCountSum(IntStream.range(0, 0).parallel().limit(4).boxed(), 0, 0); in testLimit()
89 assertCountSum(IntStream.range(1, 3).parallel().limit(4).boxed(), 2, 3); in testLimit()
90 assertCountSum(IntStream.range(1, 5).parallel().limit(4).boxed(), 4, 10); in testLimit()
91 assertCountSum(IntStream.range(1, 9).parallel().limit(4).boxed(), 4, 10); in testLimit()
93 exerciseOps(EMPTY_INT_ARRAY, s -> s.limit(0), EMPTY_INT_ARRAY); in testLimit()
94 exerciseOps(EMPTY_INT_ARRAY, s -> s.limit(10), EMPTY_INT_ARRAY); in testLimit()
[all …]
DSliceOpTest.java78 assertCountSum(countTo(0).stream().limit(4), 0, 0); in testLimit()
79 assertCountSum(countTo(2).stream().limit(4), 2, 3); in testLimit()
80 assertCountSum(countTo(4).stream().limit(4), 4, 10); in testLimit()
81 assertCountSum(countTo(8).stream().limit(4), 4, 10); in testLimit()
83 assertCountSum(countTo(0).parallelStream().limit(4), 0, 0); in testLimit()
84 assertCountSum(countTo(2).parallelStream().limit(4), 2, 3); in testLimit()
85 assertCountSum(countTo(4).parallelStream().limit(4), 4, 10); in testLimit()
86 assertCountSum(countTo(8).parallelStream().limit(4), 4, 10); in testLimit()
88 exerciseOps(Collections.emptyList(), s -> s.limit(0), Collections.emptyList()); in testLimit()
89 exerciseOps(Collections.emptyList(), s -> s.limit(10), Collections.emptyList()); in testLimit()
[all …]
/libcore/ojluni/src/main/java/java/util/stream/
DSliceOps.java52 private static long calcSize(long size, long skip, long limit) { in calcSize() argument
53 return size >= 0 ? Math.max(-1, Math.min(size - skip, limit)) : -1; in calcSize()
64 private static long calcSliceFence(long skip, long limit) { in calcSliceFence() argument
65 long sliceFence = limit >= 0 ? skip + limit : Long.MAX_VALUE; in calcSliceFence()
78 long skip, long limit) { in sliceSpliterator() argument
80 long sliceFence = calcSliceFence(skip, limit); in sliceSpliterator()
115 long skip, long limit) { in makeRef() argument
120 flags(limit)) { in makeRef()
122 long skip, long limit, long sizeIfKnown) { in makeRef()
126 limit = limit >= 0 ? Math.min(limit, sizeIfKnown - skip) : sizeIfKnown - skip; in makeRef()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DRandomTest.java46 final int limit = 128; // We can't test for every element in an infinite stream. in test_ints$() local
49 int[] rands = new int[limit]; in test_ints$()
50 for(int i = 0; i < limit; ++i) { in test_ints$()
54 int[] streamRands = new Random(0).ints().limit(limit).toArray(); in test_ints$()
78 final int limit = 128; // We can't test for every element in an infinite stream. in test_ints$II() local
82 int[] rands = new int[limit]; in test_ints$II()
83 for(int i = 0; i < limit; ++i) { in test_ints$II()
87 int[] streamRands = new Random(0).ints(origin, bound).limit(limit).toArray(); in test_ints$II()
121 final int limit = 128; // We can't test for every element in an infinite stream. in test_longs$() local
124 long[] rands = new long[limit]; in test_longs$()
[all …]
/libcore/ojluni/src/test/java/util/stream/boottest/java/util/stream/
DSliceSpliteratorTest.java63 void test(int size, int skip, int limit); in test() argument
73 SliceTester r = (size, skip, limit) -> { in sliceSpliteratorDataProvider()
79 return new StreamSpliterators.SliceSpliterator.OfRef<>(s, skip, limit); in sliceSpliteratorDataProvider()
86 SliceTester r = (size, skip, limit) -> { in sliceSpliteratorDataProvider()
92 return new StreamSpliterators.SliceSpliterator.OfInt(s, skip, limit); in sliceSpliteratorDataProvider()
99 SliceTester r = (size, skip, limit) -> { in sliceSpliteratorDataProvider()
105 return new StreamSpliterators.SliceSpliterator.OfLong(s, skip, limit); in sliceSpliteratorDataProvider()
112 SliceTester r = (size, skip, limit) -> { in sliceSpliteratorDataProvider()
118 return new StreamSpliterators.SliceSpliterator.OfDouble(s, skip, limit); in sliceSpliteratorDataProvider()
128 SliceTester r = (size, skip, limit) -> { in sliceSpliteratorDataProvider()
[all …]
/libcore/ojluni/src/main/java/java/util/logging/
DFileHandler.java154 private int limit; // zero => no limit. field in FileHandler
227 limit = manager.getIntProperty(cname + ".limit", 0); in configure()
228 if (limit < 0) { in configure()
229 limit = 0; in configure()
291 this.limit = 0; in FileHandler()
324 this.limit = 0; in FileHandler()
353 public FileHandler(String pattern, int limit, int count) in FileHandler() argument
355 if (limit < 0 || count < 1 || pattern.length() < 1) { in FileHandler()
361 this.limit = limit; in FileHandler()
392 public FileHandler(String pattern, int limit, int count, boolean append) in FileHandler() argument
[all …]
/libcore/xml/src/main/java/com/android/org/kxml2/io/
DKXmlParser.java144 private int limit = 0; field in KXmlParser
477 if (position + delimiter.length > limit) { in readUntil()
820 if (position + 1 >= limit && !fillBuffer(2)) { in readAttributeListDeclaration()
993 if (position >= limit && !fillBuffer(1)) { in peekType()
1001 if (position + 3 >= limit && !fillBuffer(4)) { in peekType()
1010 if ((position + 5 < limit || fillBuffer(6)) in peekType()
1065 if (position >= limit && !fillBuffer(1)) { in parseStartTag()
1100 if (position >= limit && !fillBuffer(1)) { in parseStartTag()
1109 if (position >= limit && !fillBuffer(1)) { in parseStartTag()
1350 if (position >= limit) { in readValue()
[all …]
/libcore/luni/src/main/java/java/math/
DLogical.java148 int limit = Math.min(negative.numberLength, positive.numberLength); in andDiffSigns() local
149 for ( ; i < limit; i++) { in andDiffSigns()
254 int limit = Math.min(val.numberLength, that.numberLength); in andNotPositive() local
256 for (i = val.getFirstNonzeroDigit(); i < limit; i++) { in andNotPositive()
302 int limit; in andNotNegativePositive() local
316 limit = Math.min(negative.numberLength, iPos); in andNotNegativePositive()
317 for ( ; i < limit; i++) { in andNotNegativePositive()
331 limit = Math.min(positive.numberLength, negative.numberLength); in andNotNegativePositive()
332 … for (i++; i < limit && (digit = ~(negative.digits[i] | positive.digits[i])) == 0; i++) in andNotNegativePositive()
354 limit = Math.min(positive.numberLength, negative.numberLength); in andNotNegativePositive()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
DMessageDigestSpiTest.java151 int limit = buf.limit(); in test_engineUpdateLjava_nio_ByteBuffer() local
153 assertEquals(limit, buf.limit()); in test_engineUpdateLjava_nio_ByteBuffer()
154 assertEquals(limit, buf.position()); in test_engineUpdateLjava_nio_ByteBuffer()
161 assertEquals(limit, buf.limit()); in test_engineUpdateLjava_nio_ByteBuffer()
162 assertEquals(limit, buf.position()); in test_engineUpdateLjava_nio_ByteBuffer()
/libcore/ojluni/src/main/java/java/net/
DURLStreamHandler.java122 protected void parseURL(URL u, String spec, int start, int limit) { in parseURL() argument
143 if (start < limit) { in parseURL()
146 if ((queryStart != -1) && (queryStart < limit)) { in parseURL()
147 query = spec.substring(queryStart+1, limit); in parseURL()
148 if (limit > queryStart) in parseURL()
149 limit = queryStart; in parseURL()
167 if (!isUNCName && (start <= limit - 2) && (spec.charAt(start) == '/') && in parseURL()
179 LOOP: for (i = start; i < limit; i++) { in parseURL()
281 if (start < limit) { in parseURL()
285 path = spec.substring(start, limit); in parseURL()
[all …]
/libcore/ojluni/src/main/java/java/util/zip/
DCRC32.java103 int limit = buffer.limit(); in update() local
104 assert (pos <= limit); in update()
105 int rem = limit - pos; in update()
117 buffer.position(limit); in update()
DAdler32.java106 int limit = buffer.limit(); in update() local
107 assert (pos <= limit); in update()
108 int rem = limit - pos; in update()
120 buffer.position(limit); in update()
/libcore/ojluni/src/main/java/java/util/regex/
DPattern.java1146 public String[] split(CharSequence input, int limit) { in split() argument
1148 String[] fast = fastSplit(pattern, input.toString(), limit); in split()
1154 boolean matchLimited = limit > 0; in split()
1160 if (!matchLimited || matchList.size() < limit - 1) { in split()
1175 } else if (matchList.size() == limit - 1) { // last one in split()
1188 if (!matchLimited || matchList.size() < limit) in split()
1193 if (limit == 0) in split()
1215 public static String[] fastSplit(String re, String input, int limit) { in fastSplit() argument
1247 while (separatorCount + 1 != limit && (end = input.indexOf(ch, begin)) != -1) { in fastSplit()
1252 if (limit == 0 && begin == lastPartEnd) { in fastSplit()

1234567