Home
last modified time | relevance | path

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

1234567891011

/libcore/ojluni/src/main/java/java/lang/
DAbstractStringBuilder.java56 int count; field in AbstractStringBuilder
79 return count; in length()
175 if (count < value.length) { in trimToSize()
176 value = Arrays.copyOf(value, count); in trimToSize()
210 if (count < newLength) { in setLength()
211 Arrays.fill(value, count, newLength, '\0'); in setLength()
214 count = newLength; in setLength()
236 if ((index < 0) || (index >= count)) in charAt()
263 if ((index < 0) || (index >= count)) { in codePointAt()
266 return Character.codePointAtImpl(value, index, count); in codePointAt()
[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()
DSupport_StringWriter.java113 public void write(char[] buf, int offset, int count) { in write() argument
115 if (0 <= offset && offset <= buf.length && 0 <= count in write()
116 && count <= buf.length - offset) { in write()
118 this.buf.append(buf, offset, count); in write()
172 public void write(String str, int offset, int count) { in write() argument
173 String sub = str.substring(offset, offset + count); in write()
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DCountLargeTest.java44 long count = LongStream.range(0, EXPECTED_LARGE_COUNT) in testRefLarge() local
45 .mapToObj(e -> null).count(); in testRefLarge()
47 assertEquals(count, EXPECTED_LARGE_COUNT); in testRefLarge()
51 long count = LongStream.range(0, EXPECTED_LARGE_COUNT) in testIntLarge() local
52 .mapToInt(e -> 0).count(); in testIntLarge()
54 assertEquals(count, EXPECTED_LARGE_COUNT); in testIntLarge()
58 long count = LongStream.range(0, EXPECTED_LARGE_COUNT) in testLongLarge() local
59 .count(); in testLongLarge()
61 assertEquals(count, EXPECTED_LARGE_COUNT); in testLongLarge()
65 long count = LongStream.range(0, EXPECTED_LARGE_COUNT) in testDoubleLarge() local
[all …]
/libcore/ojluni/src/main/java/java/io/
DByteArrayOutputStream.java55 protected int count; field in ByteArrayOutputStream
135 ensureCapacity(count + 1); in write()
136 buf[count] = (byte) b; in write()
137 count += 1; in write()
153 ensureCapacity(count + len); in write()
154 System.arraycopy(b, off, buf, count, len); in write()
155 count += len; in write()
167 out.write(buf, 0, count); in writeTo()
179 count = 0; in reset()
191 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()
103 int newcount = count + len; in write()
107 System.arraycopy(c, off, buf, count, len); in write()
108 count = newcount; in write()
120 int newcount = count + len; in write()
124 str.getChars(off, off + len, buf, count); in write()
125 count = newcount; in write()
[all …]
DDataInputStream.java198 int count = in.read(b, off + n, len - n); in readFully() local
199 if (count < 0) in readFully()
201 n += count; in readFully()
603 int count = 0; in readUTF() local
608 while (count < utflen) { in readUTF()
609 c = (int) bytearr[count] & 0xff; in readUTF()
611 count++; in readUTF()
615 while (count < utflen) { in readUTF()
616 c = (int) bytearr[count] & 0xff; in readUTF()
620 count++; in readUTF()
[all …]
DBufferedOutputStream.java50 protected int count; field in BufferedOutputStream
81 if (count > 0) { in flushBuffer()
82 out.write(buf, 0, count); in flushBuffer()
83 count = 0; in flushBuffer()
94 if (count >= buf.length) { in write()
97 buf[count++] = (byte)b; in write()
125 if (len > buf.length - count) { in write()
128 System.arraycopy(b, off, buf, count, len); in write()
129 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()
118 if (pos >= count) { in read()
122 int avail = count - pos; in read()
150 if (n > count - pos) { in skip()
151 n = count - pos; in skip()
165 return count - pos; in available()
DByteArrayInputStream.java89 protected int count; field in ByteArrayInputStream
106 this.count = buf.length; in ByteArrayInputStream()
126 this.count = Math.min(offset + length, buf.length); in ByteArrayInputStream()
144 return (pos < count) ? (buf[pos++] & 0xff) : -1; in read()
183 if (pos >= count) { in read()
187 int avail = count - pos; in read()
212 long k = count - pos; in skip()
232 return count - pos;
DCharArrayReader.java49 protected int count; field in CharArrayReader
58 this.count = buf.length; in CharArrayReader()
85 this.count = Math.min(offset + length, buf.length); in CharArrayReader()
103 if (pos >= count) in read()
130 if (pos >= count) { in read()
134 int avail = count - pos; in read()
164 long avail = count - pos; in skip()
186 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.java306 int count; field in Streams.AbstractStreamBuilderImpl
319 return -count - 1; in estimateSize()
352 count = -2; in StreamBuilderImpl()
359 if (count == 0) { in accept()
361 count++; in accept()
363 else if (count > 0) { in accept()
367 count++; in accept()
384 int c = count; in build()
387 count = -count - 1; in build()
404 if (count == -2) { in tryAdvance()
[all …]
/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/main/java/java/util/concurrent/
DLinkedBlockingQueue.java140 private final AtomicInteger count = new AtomicInteger(); field in LinkedBlockingQueue
290 count.set(n); in LinkedBlockingQueue()
304 return count.get(); in size()
321 return capacity - count.get(); in remainingCapacity()
338 final AtomicInteger count = this.count; in put() local
349 while (count.get() == capacity) { in put()
353 c = count.getAndIncrement(); in put()
379 final AtomicInteger count = this.count; in offer() local
382 while (count.get() == capacity) { in offer()
388 c = count.getAndIncrement(); in offer()
[all …]
DCountDownLatch.java165 Sync(int count) { in Sync() argument
166 setState(count); in Sync()
199 public CountDownLatch(int count) { in CountDownLatch() argument
200 if (count < 0) throw new IllegalArgumentException("count < 0"); in CountDownLatch()
201 this.sync = new Sync(count); in CountDownLatch()
DArrayBlockingQueue.java106 int count; field in ArrayBlockingQueue
156 count++; in enqueue()
172 count--; in dequeue()
193 count--; in removeAt()
210 count--; in removeAt()
277 count = i; in ArrayBlockingQueue()
313 if (count == items.length) in offer()
336 while (count == items.length) in put()
360 while (count == items.length) { in offer()
376 return (count == 0) ? null : dequeue(); in poll()
[all …]
/libcore/ojluni/src/main/java/java/text/
DSimpleDateFormat.java822 int count = 0; in compile() local
836 if (count != 0) { in compile()
837 encode(lastTag, count, compiledCode); in compile()
846 count = 0; in compile()
857 if (count != 0) { in compile()
858 encode(lastTag, count, compiledCode); in compile()
867 count = 0; in compile()
898 if (count != 0) { in compile()
899 encode(lastTag, count, compiledCode); in compile()
908 count = 0; in compile()
[all …]
/libcore/benchmarks/src/benchmarks/
DReferenceBenchmark.java93 AtomicInteger count; field in ReferenceBenchmark.FinalizableObject
95 public FinalizableObject(AtomicInteger count) { in FinalizableObject() argument
96 this.count = count; in FinalizableObject()
101 count.incrementAndGet(); in finalize()
109 AtomicInteger count = new AtomicInteger(0); in timeFinalization() local
111 new FinalizableObject(count); in timeFinalization()
121 int got = count.get(); in timeFinalization()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DWriterTest.java121 public void write(char[] buffer, int offset, int count) in write() argument
126 if (offset < 0 || count < 0 || offset >= buffer.length) { in write()
129 count = Math.min(count, buffer.length - offset); in write()
130 count = Math.min(count, this.length - this.offset); in write()
131 for (int i = 0; i < count; i++) { in write()
134 this.offset += count; in write()
/libcore/luni/src/test/native/
Dlibcore_libcore_icu_LocaleDataTest.cpp355 int32_t count = 0; in Java_libcore_libcore_icu_LocaleDataTest_initIcu4cLocaleData() local
356 const icu::UnicodeString* amPmStrs = dateFormatSym.getAmPmStrings(count); in Java_libcore_libcore_icu_LocaleDataTest_initIcu4cLocaleData()
357 setStringArrayField(env, localeData, "amPm", amPmStrs, count); in Java_libcore_libcore_icu_LocaleDataTest_initIcu4cLocaleData()
358 const icu::UnicodeString* erasStrs = dateFormatSym.getEras(count); in Java_libcore_libcore_icu_LocaleDataTest_initIcu4cLocaleData()
359 setStringArrayField(env, localeData, "eras", erasStrs, count); in Java_libcore_libcore_icu_LocaleDataTest_initIcu4cLocaleData()
362 dateFormatSym.getMonths(count, icu::DateFormatSymbols::FORMAT, icu::DateFormatSymbols::WIDE); in Java_libcore_libcore_icu_LocaleDataTest_initIcu4cLocaleData()
363 setStringArrayField(env, localeData, "longMonthNames", longMonthNames, count); in Java_libcore_libcore_icu_LocaleDataTest_initIcu4cLocaleData()
365 …dateFormatSym.getMonths(count, icu::DateFormatSymbols::FORMAT, icu::DateFormatSymbols::ABBREVIATED… in Java_libcore_libcore_icu_LocaleDataTest_initIcu4cLocaleData()
366 setStringArrayField(env, localeData, "shortMonthNames", shortMonthNames, count); in Java_libcore_libcore_icu_LocaleDataTest_initIcu4cLocaleData()
368 … dateFormatSym.getMonths(count, icu::DateFormatSymbols::FORMAT, icu::DateFormatSymbols::NARROW); in Java_libcore_libcore_icu_LocaleDataTest_initIcu4cLocaleData()
[all …]
/libcore/ojluni/src/main/java/java/util/logging/
DFileHandler.java155 private int count; field in FileHandler
231 count = manager.getIntProperty(cname + ".count", 1); in configure()
232 if (count <= 0) { in configure()
233 count = 1; in configure()
292 this.count = 1; in FileHandler()
325 this.count = 1; 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()
362 this.count = count; in FileHandler()
392 public FileHandler(String pattern, int limit, int count, boolean append) in FileHandler() argument
[all …]
/libcore/luni/src/main/java/libcore/util/
DArrayUtils.java34 public static void throwsIfOutOfBounds(int len, int offset, int count) { in throwsIfOutOfBounds() argument
39 if ((offset | count) < 0 || offset > len - count) { in throwsIfOutOfBounds()
41 "length=" + len + "; regionStart=" + offset + "; regionLength=" + count); in throwsIfOutOfBounds()

1234567891011