Home
last modified time | relevance | path

Searched refs:count (Results 1 – 25 of 344) sorted by relevance

12345678910>>...14

/libcore/ojluni/src/main/java/java/lang/
DAbstractStringBuilder.java72 int count; field in AbstractStringBuilder
108 int count1 = this.count; in compareTo()
109 int count2 = another.count; in compareTo()
130 return count; in length()
234 StringLatin1.inflate(value, 0, buf, 0, count); in inflate()
247 int length = count << coder; in trimToSize()
283 if (count < newLength) { in setLength()
285 StringLatin1.fillNull(value, count, newLength); in setLength()
287 StringUTF16.fillNull(value, count, newLength); in setLength()
290 count = newLength; in setLength()
[all …]
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DCountLargeTest.java49 long count = LongStream.range(0, EXPECTED_LARGE_COUNT) in testRefLarge() local
50 .mapToObj(e -> null).count(); in testRefLarge()
51 assertEquals(count, EXPECTED_LARGE_COUNT); in testRefLarge()
55 long count = LongStream.range(0, EXPECTED_LARGE_COUNT) in testRefLarge() local
56 .mapToObj(e -> null).filter(e -> true).count(); in testRefLarge()
57 assertEquals(count, EXPECTED_LARGE_COUNT); in testRefLarge()
64 long count = LongStream.range(0, EXPECTED_LARGE_COUNT) in testIntLarge() local
65 .mapToInt(e -> 0).count(); in testIntLarge()
66 assertEquals(count, EXPECTED_LARGE_COUNT); in testIntLarge()
70 long count = LongStream.range(0, EXPECTED_LARGE_COUNT) in testIntLarge() local
[all …]
DCountTest.java59 terminal(Stream::count). in testOps()
64 terminal(s -> s.skip(1), Stream::count). in testOps()
70 terminal(s -> s.filter(e -> true), Stream::count). in testOps()
85 terminal(Stream::distinct, Stream::count). in testOps()
89 terminal(s -> s.unordered().distinct(), Stream::count). in testOps()
99 terminal(IntStream::count). in testOps()
104 terminal(s -> s.skip(1), IntStream::count). in testOps()
109 terminal(s -> s.filter(e -> true), IntStream::count). in testOps()
115 terminal(IntStream::distinct, IntStream::count). in testOps()
119 terminal(s -> s.unordered().distinct(), IntStream::count). in testOps()
[all …]
DFlatMapOpTest.java92 s.get().flatMap(i -> Stream.of(i, i).onClose(onClose::getAndIncrement)).count(); in testClose()
95 s.get().flatMapToInt(i -> IntStream.of(i, i).onClose(onClose::getAndIncrement)).count(); in testClose()
98 s.get().flatMapToLong(i -> LongStream.of(i, i).onClose(onClose::getAndIncrement)).count(); in testClose()
101 … s.get().flatMapToDouble(i -> DoubleStream.of(i, i).onClose(onClose::getAndIncrement)).count(); in testClose()
111 flatMap(i -> IntStream.of(i, i).onClose(onClose::getAndIncrement)).count(); in testIntClose()
121 flatMap(i -> LongStream.of(i, i).onClose(onClose::getAndIncrement)).count(); in testLongClose()
131 flatMap(i -> DoubleStream.of(i, i).onClose(onClose::getAndIncrement)).count(); in testDoubleClose()
156 AtomicInteger count = new AtomicInteger(); in testOpsShortCircuit() local
158 peek(i -> count.incrementAndGet()). in testOpsShortCircuit()
160 assertEquals(count.get(), 10); in testOpsShortCircuit()
[all …]
/libcore/support/src/test/java/tests/support/
DSupport_StringReader.java30 private int count; field in Support_StringReader
43 this.count = str.length(); in Support_StringReader()
121 if (pos != count) { in read()
148 public int read(char buf[], int offset, int count) throws IOException { in read() argument
150 if (0 <= offset && offset <= buf.length && 0 <= count in read()
151 && count <= buf.length - offset) { in read()
154 if (pos == this.count) { in read()
157 int end = pos + count > this.count ? this.count : pos in read()
158 + count; in read()
228 public long skip(long count) throws IOException { in skip() argument
[all …]
DStreams.java39 int count; in streamToBytes() local
40 while ((count = source.read(buffer)) != -1) { in streamToBytes()
41 out.write(buffer, 0, count); in streamToBytes()
52 int count; in streamToString() local
53 while ((count = fileReader.read(buffer)) != -1) { in streamToString()
54 out.write(buffer, 0, count); in streamToString()
/libcore/ojluni/src/main/java/java/io/
DByteArrayOutputStream.java57 protected int count; field in ByteArrayOutputStream
137 ensureCapacity(count + 1); in write()
138 buf[count] = (byte) b; in write()
139 count += 1; in write()
156 ensureCapacity(count + len); in write()
157 System.arraycopy(b, off, buf, count, len); in write()
158 count += len; in write()
187 out.write(buf, 0, count); in writeTo()
199 count = 0; in reset()
211 return Arrays.copyOf(buf, count); in toByteArray()
[all …]
DCharArrayWriter.java52 protected int count; field in CharArrayWriter
80 int newcount = count + 1; in write()
84 buf[count] = (char)c; in write()
85 count = newcount; in write()
108 int newcount = count + len; in write()
112 System.arraycopy(c, off, buf, count, len); in write()
113 count = newcount; in write()
130 int newcount = count + len; in write()
134 str.getChars(off, off + len, buf, count); in write()
135 count = newcount; in write()
[all …]
DDataInputStream.java203 int count = in.read(b, off + n, len - n); in readFully() local
204 if (count < 0) in readFully()
206 n += count; in readFully()
608 int count = 0; in readUTF() local
613 while (count < utflen) { in readUTF()
614 c = (int) bytearr[count] & 0xff; in readUTF()
616 count++; in readUTF()
620 while (count < utflen) { in readUTF()
621 c = (int) bytearr[count] & 0xff; in readUTF()
625 count++; in readUTF()
[all …]
DByteArrayInputStream.java91 protected int count; field in ByteArrayInputStream
108 this.count = buf.length; in ByteArrayInputStream()
128 this.count = Math.min(offset + length, buf.length); in ByteArrayInputStream()
146 return (pos < count) ? (buf[pos++] & 0xff) : -1; in read()
175 if (pos >= count) { in read()
179 int avail = count - pos; in read()
192 byte[] result = Arrays.copyOfRange(buf, pos, count); in readAllBytes()
193 pos = count; in readAllBytes()
203 int len = count - pos; in transferTo()
205 pos = count; in transferTo()
[all …]
DBufferedOutputStream.java49 protected int count; field in BufferedOutputStream
80 if (count > 0) { in flushBuffer()
81 out.write(buf, 0, count); in flushBuffer()
82 count = 0; in flushBuffer()
94 if (count >= buf.length) { in write()
97 buf[count++] = (byte)b; in write()
126 if (len > buf.length - count) { in write()
129 System.arraycopy(b, off, buf, count, len); in write()
130 count += len; in write()
DStringBufferInputStream.java65 protected int count; field in StringBufferInputStream
74 count = s.length(); in StringBufferInputStream()
92 return (pos < count) ? (buffer.charAt(pos++) & 0xFF) : -1; in read()
119 if (pos >= count) { in read()
123 int avail = count - pos; in read()
147 if (n > count - pos) { in skip()
148 n = count - pos; in skip()
162 return count - pos; in available()
DCharArrayReader.java52 protected int count; field in CharArrayReader
61 this.count = buf.length; in CharArrayReader()
88 this.count = Math.min(offset + length, buf.length); in CharArrayReader()
106 if (pos >= count) in read()
139 if (pos >= count) { in read()
143 int avail = count - pos; in read()
161 if (pos >= count) { in read()
165 int avail = count - pos; in read()
192 long avail = count - pos; in skip()
213 return (count - pos) > 0; in ready()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/jar/
DJarInputStreamTest.java163 int count = 0; in test_JarInputStream_Integrate_Jar_getNextEntry() local
164 while (count == 0 || entry != null) { in test_JarInputStream_Integrate_Jar_getNextEntry()
165 count++; in test_JarInputStream_Integrate_Jar_getNextEntry()
168 assertEquals(TOTAL_ENTRIES + 1, count); in test_JarInputStream_Integrate_Jar_getNextEntry()
180 int count = 0; in test_JarInputStream_Modified_Class_getNextEntry() local
181 while (count == 0 || zipEntry != null) { in test_JarInputStream_Modified_Class_getNextEntry()
182 count++; in test_JarInputStream_Modified_Class_getNextEntry()
185 if (count == TEST_CLASS_INDEX + 1) { in test_JarInputStream_Modified_Class_getNextEntry()
189 if (count != TEST_CLASS_INDEX + 1) { in test_JarInputStream_Modified_Class_getNextEntry()
195 assertEquals(TOTAL_ENTRIES + 2, count); in test_JarInputStream_Modified_Class_getNextEntry()
[all …]
/libcore/ojluni/src/main/java/java/util/stream/
DStreams.java298 int count; field in Streams.AbstractStreamBuilderImpl
311 return -count - 1; in estimateSize()
344 count = -2; in StreamBuilderImpl()
351 if (count == 0) { in accept()
353 count++; in accept()
355 else if (count > 0) { in accept()
359 count++; in accept()
376 int c = count; in build()
379 count = -count - 1; in build()
396 if (count == -2) { in tryAdvance()
[all …]
DNode.java123 if (from == 0 && to == count()) in truncate()
130 if (to == count()) { in truncate()
188 long count(); in count() method
273 long size = count(); in asArray()
276 T[] boxed = generator.apply((int) count()); in asArray()
299 T_ARR newArray(int count); in newArray() argument
362 if (from == 0 && to == count()) in truncate()
369 if (to == count()) { in truncate()
379 default int[] newArray(int count) { in newArray() argument
380 return new int[count]; in newArray()
[all …]
/libcore/ojluni/src/main/java/java/util/
DIntSummaryStatistics.java66 private long count; field in IntSummaryStatistics
108 public IntSummaryStatistics(long count, int min, int max, long sum) in IntSummaryStatistics() argument
110 if (count < 0L) { in IntSummaryStatistics()
112 } else if (count > 0L) { in IntSummaryStatistics()
115 this.count = count; in IntSummaryStatistics()
130 ++count; in accept()
143 count += other.count; in combine()
155 return count; in getCount()
DLongSummaryStatistics.java67 private long count; field in LongSummaryStatistics
109 public LongSummaryStatistics(long count, long min, long max, long sum) in LongSummaryStatistics() argument
111 if (count < 0L) { in LongSummaryStatistics()
113 } else if (count > 0L) { in LongSummaryStatistics()
116 this.count = count; in LongSummaryStatistics()
141 ++count; in accept()
155 count += other.count; in combine()
167 return count; in getCount()
DDoubleSummaryStatistics.java67 private long count; field in DoubleSummaryStatistics
111 public DoubleSummaryStatistics(long count, double min, double max, double sum) in DoubleSummaryStatistics() argument
113 if (count < 0L) { in DoubleSummaryStatistics()
115 } else if (count > 0L) { in DoubleSummaryStatistics()
120 var ncount = DoubleStream.of(min, max, sum).filter(Double::isNaN).count(); in DoubleSummaryStatistics()
124 this.count = count; in DoubleSummaryStatistics()
141 ++count; in accept()
156 count += other.count; in combine()
183 return count; in getCount()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
DSourceChannelTest.java69 int count = source.read(ByteBuffer.allocate(10)); in test_read_LByteBuffer_DataAvailable() local
70 assertEquals(1, count); in test_read_LByteBuffer_DataAvailable()
93 long count = source.read(readBuf); in test_read_LByteBuffer_SinkClosed() local
94 assertEquals(BUFFER_SIZE, count); in test_read_LByteBuffer_SinkClosed()
96 count = source.read(readBuf); in test_read_LByteBuffer_SinkClosed()
97 assertEquals(0, count); in test_read_LByteBuffer_SinkClosed()
100 count = source.read(readBuf); in test_read_LByteBuffer_SinkClosed()
101 assertEquals(-1, count); in test_read_LByteBuffer_SinkClosed()
176 long count = source.read(readBufArray); in test_read_$LByteBuffer() local
177 if (count < 0) { in test_read_$LByteBuffer()
[all …]
/libcore/ojluni/src/main/java/sun/net/www/
DMeteredStream.java42 protected long count = 0; field in MeteredStream
72 count += n; in justRead()
77 if (count - markedCount > markLimit) { in justRead()
82 pi.updateProgress(count, expected); in justRead()
91 if (count >= expected) { in justRead()
107 if (count - markedCount > markLimit) { in isMarked()
153 long min = (n > expected - count) ? expected - count: n; in skip()
187 markedCount = count; in mark()
200 count = markedCount; in reset()
/libcore/ojluni/src/test/java/util/Random/
DRandomStreamTest.java67 public void testRandomIntStream(final Random random, final int count) { in testRandomIntStream() argument
68 final List<Integer> destination = new ArrayList<>(count); in testRandomIntStream()
69 random.ints().limit(count).forEach(destination::add); in testRandomIntStream()
70 assertEquals(destination.size(), count); in testRandomIntStream() local
74 public void testRandomLongStream(final Random random, final int count) { in testRandomLongStream() argument
75 final List<Long> destination = new ArrayList<>(count); in testRandomLongStream()
76 random.longs().limit(count).forEach(destination::add); in testRandomLongStream()
77 assertEquals(destination.size(), count); in testRandomLongStream() local
81 public void testRandomDoubleStream(final Random random, final int count) { in testRandomDoubleStream() argument
82 final List<Double> destination = new ArrayList<>(count); in testRandomDoubleStream()
[all …]
/libcore/ojluni/src/main/java/java/util/concurrent/
DLinkedBlockingQueue.java141 private final AtomicInteger count = new AtomicInteger(); field in LinkedBlockingQueue
285 count.set(n); in LinkedBlockingQueue()
299 return count.get(); in size()
316 return capacity - count.get(); in remainingCapacity()
331 final AtomicInteger count = this.count; in put() local
342 while (count.get() == capacity) { in put()
346 c = count.getAndIncrement(); in put()
372 final AtomicInteger count = this.count; in offer() local
375 while (count.get() == capacity) { in offer()
381 c = count.getAndIncrement(); in offer()
[all …]
/libcore/ojluni/src/test/java/lang/StackWalker/
DMultiThreadStackWalk.java135 final long count = frameCounter.getAndIncrement(); in consume() local
138 .append(count) in consume()
155 if (count == max) { in consume()
158 if (count == checkMarkAt) { in consume()
160 throw new RuntimeException("Expected Marker at " + count in consume()
164 if (count <= 0 && sfi.getDeclaringClass() != MultiThreadStackWalk.Call.class) { in consume()
165 throw new RuntimeException("Expected Call at " + count in consume()
167 …} else if (count > 0 && count < max && sfi.getDeclaringClass() != MultiThreadStackWalk.Test.class)… in consume()
168 throw new RuntimeException("Expected Test at " + count in consume()
170 } else if (count == max && sfi.getDeclaringClass() != MultiThreadStackWalk.class) { in consume()
[all …]
/libcore/ojluni/src/main/java/java/text/
DSimpleDateFormat.java841 int count = 0; in compile() local
855 if (count != 0) { in compile()
856 encode(lastTag, count, compiledCode); in compile()
865 count = 0; in compile()
876 if (count != 0) { in compile()
877 encode(lastTag, count, compiledCode); in compile()
886 count = 0; in compile()
917 if (count != 0) { in compile()
918 encode(lastTag, count, compiledCode); in compile()
927 count = 0; in compile()
[all …]

12345678910>>...14