Home
last modified time | relevance | path

Searched refs:n (Results 1 – 25 of 435) sorted by relevance

12345678910>>...18

/libcore/ojluni/src/main/java/sun/util/calendar/
DCalendarUtils.java70 public static final long floorDivide(long n, long d) { in floorDivide() argument
71 return ((n >= 0) ? in floorDivide()
72 (n / d) : (((n + 1L) / d) - 1L)); in floorDivide()
84 public static final int floorDivide(int n, int d) { in floorDivide() argument
85 return ((n >= 0) ? in floorDivide()
86 (n / d) : (((n + 1) / d) - 1)); in floorDivide()
102 public static final int floorDivide(int n, int d, int[] r) { in floorDivide() argument
103 if (n >= 0) { in floorDivide()
104 r[0] = n % d; in floorDivide()
105 return n / d; in floorDivide()
[all …]
/libcore/ojluni/src/main/java/sun/nio/ch/
DIOStatus.java59 public static int normalize(int n) { in normalize() argument
60 if (n == UNAVAILABLE) in normalize()
62 return n; in normalize()
65 public static boolean check(int n) { in check() argument
66 return (n >= UNAVAILABLE); in check()
69 public static long normalize(long n) { in normalize() argument
70 if (n == UNAVAILABLE) in normalize()
72 return n; in normalize()
75 public static boolean check(long n) { in check() argument
76 return (n >= UNAVAILABLE); in check()
[all …]
DSimpleAsynchronousFileChannelImpl.java109 long n = 0L; in size() local
113 n = nd.size(fdObj); in size()
114 } while ((n == IOStatus.INTERRUPTED) && isOpen()); in size()
115 return n; in size()
117 end(n >= 0L); in size()
132 long n = 0L; in truncate() local
136 n = nd.size(fdObj); in truncate()
137 } while ((n == IOStatus.INTERRUPTED) && isOpen()); in truncate()
140 if (size < n && isOpen()) { in truncate()
142 n = nd.truncate(fdObj, size); in truncate()
[all …]
DSocketChannelImpl.java343 int n = 0; in read() local
421 n = IOUtil.read(fd, buf, -1, nd); in read()
422 if ((n == IOStatus.INTERRUPTED) && isOpen()) { in read()
427 return IOStatus.normalize(n); in read()
448 end(n > 0 || (n == IOStatus.UNAVAILABLE)); in read()
453 if ((n <= 0) && (!isInputOpen)) in read()
457 assert IOStatus.check(n); in read()
471 long n = 0; in read() local
481 n = IOUtil.read(fd, dsts, offset, length, nd); in read()
482 if ((n == IOStatus.INTERRUPTED) && isOpen()) in read()
[all …]
DDatagramChannelImpl.java373 int n = 0; in receive() local
383 n = receive(fd, dst); in receive()
384 } while ((n == IOStatus.INTERRUPTED) && isOpen()); in receive()
385 if (n == IOStatus.UNAVAILABLE) in receive()
391 n = receive(fd, bb); in receive()
392 } while ((n == IOStatus.INTERRUPTED) && isOpen()); in receive()
393 if (n == IOStatus.UNAVAILABLE) in receive()
403 n = 0; in receive()
416 end((n > 0) || (n == IOStatus.UNAVAILABLE)); in receive()
417 assert IOStatus.check(n); in receive()
[all …]
/libcore/ojluni/src/test/java/util/concurrent/tck/
DTimeUnit8Test.java112 long n = ThreadLocalRandom.current().nextLong(); in testConvertDuration_roundtripDurationOf() local
114 assertEquals(n, NANOSECONDS.convert(Duration.ofNanos(n))); in testConvertDuration_roundtripDurationOf()
115 assertEquals(n, NANOSECONDS.convert(Duration.of(n, ChronoUnit.NANOS))); in testConvertDuration_roundtripDurationOf()
116 assertEquals(n, MILLISECONDS.convert(Duration.ofMillis(n))); in testConvertDuration_roundtripDurationOf()
117 assertEquals(n, MILLISECONDS.convert(Duration.of(n, ChronoUnit.MILLIS))); in testConvertDuration_roundtripDurationOf()
118 assertEquals(n, SECONDS.convert(Duration.ofSeconds(n))); in testConvertDuration_roundtripDurationOf()
119 assertEquals(n, SECONDS.convert(Duration.of(n, ChronoUnit.SECONDS))); in testConvertDuration_roundtripDurationOf()
120 n /= 60; in testConvertDuration_roundtripDurationOf()
121 assertEquals(n, MINUTES.convert(Duration.ofMinutes(n))); in testConvertDuration_roundtripDurationOf()
122 assertEquals(n, MINUTES.convert(Duration.of(n, ChronoUnit.MINUTES))); in testConvertDuration_roundtripDurationOf()
[all …]
DCountedCompleter8Test.java115 int n = hi - lo; in forEach3() local
116 for (; n >= 2; n /= 2) { in forEach3()
118 new Task(this, lo + n/2, lo + n).fork(); in forEach3()
120 if (n > 0) in forEach3()
138 for (int n = hi - lo; n >= 2; n /= 2) in forEach4()
139 new Task(this, lo + n/2, lo + n).fork(); in forEach4()
150 int n = ThreadLocalRandom.current().nextInt(8); in testRecursiveDecomposition() local
151 Integer[] a = new Integer[n]; in testRecursiveDecomposition()
152 for (int i = 0; i < n; i++) a[i] = i + 1; in testRecursiveDecomposition()
155 assertEquals(n * (n + 1) / 2, ai.get()); in testRecursiveDecomposition()
/libcore/ojluni/src/main/java/java/util/zip/
DGZIPInputStream.java135 int n = super.read(buf, off, len); in read() local
136 if (n == -1) { in read()
142 crc.update(buf, off, n); in read()
144 return n; in read()
193 int n = 2 + 2 + 6; in readHeader() local
198 n += m + 2; in readHeader()
203 n++; in readHeader()
209 n++; in readHeader()
218 n += 2; in readHeader()
221 return n; in readHeader()
[all …]
DDeflaterInputStream.java185 int n; in read() local
189 n = in.read(buf, 0, buf.length); in read()
190 if (n < 0) { in read()
193 } else if (n > 0) { in read()
194 def.setInput(buf, 0, n); in read()
199 n = def.deflate(b, off, len); in read()
200 cnt += n; in read()
201 off += n; in read()
202 len -= n; in read()
237 public long skip(long n) throws IOException { in skip() argument
[all …]
/libcore/ojluni/src/test/java/lang/invoke/
DClassValueTest.java91 static String nameForCVN(Class<?> type, int n) { in nameForCVN() argument
92 return "CV[" + n + "]" + type.getName(); in nameForCVN()
96 final int n; field in ClassValueTest.CVN
97 CVN(int n) { this.n = n; } in CVN() argument
100 return nameForCVN(type, n); in computeValue()
108 for (int n = 0; n < cvns.length; n++) { in testGetMany()
109 cvns[n] = new CVN(n); in testGetMany()
117 int n = i1*CVN_COUNT2 + i2; in testGetMany() local
119 assertEquals(nameForCVN(c, n), cvns[n].get(c)); in testGetMany()
120 cvns[n].get(c); //get it again in testGetMany()
[all …]
/libcore/ojluni/src/main/java/java/io/
DInputStream.java141 public long skip(long n) throws IOException { in nullInputStream() argument
147 public void skipNBytes(long n) throws IOException { in nullInputStream() argument
149 if (n > 0) { in nullInputStream()
403 int n; in readNBytes() local
409 while ((n = read(buf, nread, in readNBytes()
411 nread += n; in readNBytes()
412 remaining -= n; in readNBytes()
435 } while (n >= 0 && remaining > 0); in readNBytes()
504 int n = 0; in readNBytes() local
505 while (n < len) { in readNBytes()
[all …]
DBufferedInputStream.java239 int n = getInIfOpen().read(buffer, pos, buffer.length - pos); in fill() local
240 if (n > 0) in fill()
241 count = n + pos; in fill()
336 int n = 0; in read() local
338 int nread = read1(b, off + n, len - n); in read()
340 return (n == 0) ? nread : n; in read()
341 n += nread; in read()
342 if (n >= len) in read()
343 return n; in read()
347 return n; in read()
[all …]
/libcore/ojluni/src/test/java/lang/Long/
DParsingTest.java117 long n = Long.parseLong(val); in check() local
118 if (n != expected) in check()
120 val + " Result:" + n); in check()
124 long n = 0L; in checkFailure() local
126 n = Long.parseLong(val); in checkFailure()
127 System.err.println("parseLong(" + val + ") incorrectly returned " + n); in checkFailure()
135 long n = 0; in checkNumberFormatException() local
139 n = Long_parseLong(val, start, end, radix); in checkNumberFormatException()
141 ") incorrectly returned " + n); in checkNumberFormatException()
149 long n = 0; in checkIndexOutOfBoundsException() local
[all …]
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DStreamLinkTest.java49 private <S> Function<S, S> apply(int n, Function<S, S> f) { in apply() argument
51 for (int i = 0; i < n; i++) { in apply()
62 for (int n : sizes) {
63 setContext("n", n);
64 … List<Integer> expected = data.stream().map(e -> (Integer) (e + n)).collect(Collectors.toList());
67 stream(apply(n, (Stream<Integer> s) -> s.map(e -> (Integer) (e + 1)))).
75 for (int n : sizes) { in testIntManyStreams()
76 setContext("n", n); in testIntManyStreams()
77 int[] expected = data.stream().map(e -> e + n).toArray(); in testIntManyStreams()
80 stream(apply(n, (IntStream s) -> s.map(e -> e + 1))). in testIntManyStreams()
[all …]
/libcore/ojluni/src/main/java/java/util/concurrent/
DConcurrentSkipListMap.java414 static <K,V> void unlinkNode(Node<K,V> b, Node<K,V> n) { in unlinkNode() argument
415 if (b != null && n != null) { in unlinkNode()
418 if ((f = n.next) != null && f.key == null) { in unlinkNode()
422 else if (NEXT.compareAndSet(n, f, in unlinkNode()
428 NEXT.compareAndSet(b, n, p); in unlinkNode()
511 Node<K,V> n; K k; V v; int c; in findNode() local
512 if ((n = b.next) == null) in findNode()
514 else if ((k = n.key) == null) in findNode()
516 else if ((v = n.val) == null) in findNode()
517 unlinkNode(b, n); // n is deleted in findNode()
[all …]
DPriorityBlockingQueue.java259 int n = es.length; in PriorityBlockingQueue() local
264 es = Arrays.copyOf(es, n, Object[].class); in PriorityBlockingQueue()
265 if (screen && (n == 1 || this.comparator != null)) { in PriorityBlockingQueue()
271 this.size = n; in PriorityBlockingQueue()
324 final int n; in dequeue() local
325 final E x = (E) es[(n = --size)]; in dequeue()
326 es[n] = null; in dequeue()
327 if (n > 0) { in dequeue()
330 siftDownComparable(0, x, es, n); in dequeue()
332 siftDownUsingComparator(0, x, es, n, cmp); in dequeue()
[all …]
/libcore/ojluni/src/test/java/lang/Integer/
DParsingTest.java125 int n = Integer.parseInt(val); in check() local
126 if (n != expected) in check()
128 val + " Result:" + n); in check()
132 int n = 0; in checkFailure() local
134 n = Integer.parseInt(val); in checkFailure()
135 System.err.println("parseInt(" + val + ") incorrectly returned " + n); in checkFailure()
143 int n = 0; in checkNumberFormatException() local
147 n = Integer_parseInt(val, start, end, radix); in checkNumberFormatException()
149 ") incorrectly returned " + n); in checkNumberFormatException()
157 int n = 0; in checkIndexOutOfBoundsException() local
[all …]
/libcore/ojluni/src/test/java/io/InputStream/
DSkip.java153 final long n = 31; // skip count in testSkip() local
158 dotestExact(in, pos, streamLength, n, true, false); in testSkip()
161 in.setState(n + 1, 100); in testSkip()
162 dotestExact(in, pos, streamLength, n, true, false); in testSkip()
163 pos += n + 1; in testSkip()
166 in.setState(n/2, n/2 + n/4); in testSkip()
167 dotestExact(in, pos, streamLength, n, false, true); in testSkip()
168 pos += n/2 + n/4; in testSkip()
171 in.setState(n/2, n); in testSkip()
172 dotestExact(in, pos, streamLength, n, false, false); in testSkip()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
DSSLEngineResultTest.java102 for (int n = 0; n < pos.length; n++) { in test_bytesConsumed()
105 enHS[j], pos[n], pos[l]); in test_bytesConsumed()
106 assertEquals("Incorrect bytesConsumed", pos[n], in test_bytesConsumed()
125 for (int n = 0; n < pos.length; n++) { in test_bytesProduced()
128 enHS[j], pos[n], pos[l]); in test_bytesProduced()
148 for (int n = 0; n < pos.length; n++) { in test_getHandshakeStatus()
151 enHS[j], pos[n], pos[l]); in test_getHandshakeStatus()
171 for (int n = 0; n < pos.length; n++) { in test_getStatus()
174 enHS[j], pos[n], pos[l]); in test_getStatus()
194 for (int n = 0; n < pos.length; n++) { in test_toString()
[all …]
/libcore/ojluni/src/main/java/sun/net/www/
DMeteredStream.java59 private final void justRead(long n) throws IOException { in justRead() argument
60 if (n == -1) { in justRead()
72 count += n; in justRead()
133 int n = in.read(b, off, len); in read() local
134 justRead(n); in read()
135 return n; in read()
138 public synchronized long skip(long n) throws IOException { in skip() argument
153 long min = (n > expected - count) ? expected - count: n; in skip()
154 n = in.skip(min); in skip()
156 justRead(n); in skip()
[all …]
/libcore/luni/src/main/java/org/apache/harmony/xml/dom/
DTextImpl.java78 for (TextImpl n = firstTextNodeInCurrentRun(); n != null; n = n.nextTextNode()) { in getWholeText()
79 n.appendDataTo(result); in getWholeText()
93 for (TextImpl n = firstTextNodeInCurrentRun(); n != null; ) { in replaceWholeText()
96 if (n == this && content != null && content.length() > 0) { in replaceWholeText()
99 n = n.nextTextNode(); in replaceWholeText()
102 Node toRemove = n; // because removeChild() detaches siblings in replaceWholeText()
103 n = n.nextTextNode(); in replaceWholeText()
/libcore/ojluni/src/main/native/
DUnixCopyFile.c60 ssize_t n, pos, len; in Java_sun_nio_fs_UnixCopyFile_transfer() local
61 RESTARTABLE(read((int)src, &buf, sizeof(buf)), n); in Java_sun_nio_fs_UnixCopyFile_transfer()
62 if (n <= 0) { in Java_sun_nio_fs_UnixCopyFile_transfer()
63 if (n < 0) in Java_sun_nio_fs_UnixCopyFile_transfer()
72 len = n; in Java_sun_nio_fs_UnixCopyFile_transfer()
76 RESTARTABLE(write((int)dst, bufp, len), n); in Java_sun_nio_fs_UnixCopyFile_transfer()
77 if (n == -1) { in Java_sun_nio_fs_UnixCopyFile_transfer()
81 pos += n; in Java_sun_nio_fs_UnixCopyFile_transfer()
82 len -= n; in Java_sun_nio_fs_UnixCopyFile_transfer()
/libcore/ojluni/src/test/java/lang/Float/
DParseFloatTest.java41 private static void fail(String val, float n) { in fail() argument
42 Assert.fail("Float.parseFloat failed. String:" + val + " Result:" + n); in fail()
46 float n = Float.parseFloat(val); in check() local
47 boolean isNegativeN = n < 0 || n == 0 && 1/n < 0; in check()
48 float na = Math.abs(n); in check()
64 if (!Float.isNaN(n)) { in check()
65 fail(val, n); in check()
69 if (Float.isNaN(n)) { in check()
70 fail(val, n); in check()
73 fail(val, n); in check()
[all …]
/libcore/ojluni/src/main/java/sun/nio/cs/
DStreamDecoder.java130 int n = read(cb, 0, 2); in read0() local
131 switch (n) { in read0()
141 assert false : n; in read0()
159 int n = 0; in read() local
166 n = 1; in read()
169 return n; in read()
176 return (n == 0) ? -1 : n; in read()
178 return n + 1; in read()
181 return n + implRead(cbuf, off, off + len); in read()
281 int n = sun.nio.ch.ChannelInputStream.read(ch, bb, true); in readBytes() local
[all …]
/libcore/ojluni/src/main/java/java/net/
DURI.java1700 int n = s.length(); in equal() local
1701 for (int i = 0; i < n;) { in equal()
1729 int n = s.length(); in equalIgnoringCase() local
1730 if (t.length() != n) in equalIgnoringCase()
1732 for (int i = 0; i < n; i++) { in equalIgnoringCase()
1769 int n = s.length(); in hashIgnoringCase() local
1770 for (int i = 0; i < n; i++) in hashIgnoringCase()
1794 int n = sn < tn ? sn : tn; in compareIgnoringCase() local
1795 for (int i = 0; i < n; i++) { in compareIgnoringCase()
2508 int n = chars.length(); in lowMask() local
[all …]

12345678910>>...18