Home
last modified time | relevance | path

Searched refs:Long (Results 1 – 25 of 336) sorted by relevance

12345678910>>...14

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DLongTest.java41 Long l = new Long(127); in test_byteValue()
43 assertEquals("Returned incorrect byte value", -1, new Long(Long.MAX_VALUE) in test_byteValue()
52 assertTrue("-2 compared to 1 gave non-negative answer", new Long(-2L) in test_compareToLjava_lang_Long()
53 .compareTo(new Long(1L)) < 0); in test_compareToLjava_lang_Long()
54 assertEquals("-2 compared to -2 gave non-zero answer", 0, new Long(-2L) in test_compareToLjava_lang_Long()
55 .compareTo(new Long(-2L))); in test_compareToLjava_lang_Long()
56 assertTrue("3 compared to 2 gave non-positive answer", new Long(3L) in test_compareToLjava_lang_Long()
57 .compareTo(new Long(2L)) > 0); in test_compareToLjava_lang_Long()
60 new Long(0).compareTo(null); in test_compareToLjava_lang_Long()
72 assertEquals("Returned incorrect value for hex string", 255L, Long.decode( in test_decodeLjava_lang_String2()
[all …]
/libcore/luni/src/test/java/libcore/java/lang/
DLongTest.java30 assertNull(Long.getLong("testIncLong")); in testSystemProperties()
31 assertEquals(new Long(4), Long.getLong("testIncLong", 4L)); in testSystemProperties()
32 assertEquals(new Long(4), Long.getLong("testIncLong", new Long(4))); in testSystemProperties()
39 final long min = Long.MIN_VALUE; in testCompare()
41 final long max = Long.MAX_VALUE; in testCompare()
42 assertTrue(Long.compare(max, max) == 0); in testCompare()
43 assertTrue(Long.compare(min, min) == 0); in testCompare()
44 assertTrue(Long.compare(zero, zero) == 0); in testCompare()
45 assertTrue(Long.compare(max, zero) > 0); in testCompare()
46 assertTrue(Long.compare(max, min) > 0); in testCompare()
[all …]
DStrictMathTest.java81 testLongExact(Long.MAX_VALUE, 1); in testLongExact()
82 testLongExact(Long.MAX_VALUE, -1); in testLongExact()
83 testLongExact(Long.MIN_VALUE, 1); in testLongExact()
84 testLongExact(Long.MIN_VALUE, -1); in testLongExact()
85 testLongExact(Long.MAX_VALUE, Long.MAX_VALUE); in testLongExact()
86 testLongExact(Long.MIN_VALUE, Long.MIN_VALUE); in testLongExact()
191 testFloorDivModL(Long.MAX_VALUE, 1L); in testLongFloorDivMod()
192 testFloorDivModL(Long.MAX_VALUE, -1L); in testLongFloorDivMod()
193 testFloorDivModL(Long.MIN_VALUE, 1L); in testLongFloorDivMod()
194 testFloorDivModL(Long.MIN_VALUE, -1L); in testLongFloorDivMod()
DMathTest.java117 testLongExact(Long.MAX_VALUE, 1); in testLongExact()
118 testLongExact(Long.MAX_VALUE, -1); in testLongExact()
119 testLongExact(Long.MIN_VALUE, 1); in testLongExact()
120 testLongExact(Long.MIN_VALUE, -1); in testLongExact()
121 testLongExact(Long.MAX_VALUE, Long.MAX_VALUE); in testLongExact()
122 testLongExact(Long.MIN_VALUE, Long.MIN_VALUE); in testLongExact()
263 testFloorDivModL(Long.MAX_VALUE, 1L); in testLongFloorDivMod()
264 testFloorDivModL(Long.MAX_VALUE, -1L); in testLongFloorDivMod()
265 testFloorDivModL(Long.MIN_VALUE, 1L); in testLongFloorDivMod()
266 testFloorDivModL(Long.MIN_VALUE, -1L); in testLongFloorDivMod()
/libcore/jsr166-tests/src/test/java/jsr166/
DConcurrentHashMap8Test.java564 static ConcurrentHashMap<Long, Long> longMap;
566 static ConcurrentHashMap<Long, Long> longMap() { in longMap()
568 longMap = new ConcurrentHashMap<Long, Long>(SIZE); in longMap()
570 longMap.put(Long.valueOf(i), Long.valueOf(2 *i)); in longMap()
576 …tic class AddKeys implements BiFunction<Map.Entry<Long,Long>, Map.Entry<Long,Long>, Map.Entry<Long
577 public Map.Entry<Long,Long> apply(Map.Entry<Long,Long> x, Map.Entry<Long,Long> y) { in apply() argument
578 return new AbstractMap.SimpleEntry<Long,Long> in apply()
579 (Long.valueOf(x.getKey().longValue() + y.getKey().longValue()), in apply()
580 Long.valueOf(1L)); in apply()
589 ConcurrentHashMap<Long, Long> m = longMap(); in testForEachKeySequentially()
[all …]
DLongAccumulatorTest.java32 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testConstructor()
40 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testAccumulateAndGet()
53 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testReset()
64 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testGetThenReset()
75 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testToString()
78 assertEquals(Long.toString(1), ai.toString()); in testToString()
85 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testIntValue()
95 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testLongValue()
105 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testFloatValue()
115 LongAccumulator ai = new LongAccumulator(Long::max, 0L); in testDoubleValue()
[all …]
DTimeUnitTest.java271 assertEquals(Long.MAX_VALUE, in testConvertSaturate()
272 NANOSECONDS.convert(Long.MAX_VALUE / 2, SECONDS)); in testConvertSaturate()
273 assertEquals(Long.MIN_VALUE, in testConvertSaturate()
274 NANOSECONDS.convert(-Long.MAX_VALUE / 4, SECONDS)); in testConvertSaturate()
275 assertEquals(Long.MAX_VALUE, in testConvertSaturate()
276 NANOSECONDS.convert(Long.MAX_VALUE / 2, MINUTES)); in testConvertSaturate()
277 assertEquals(Long.MIN_VALUE, in testConvertSaturate()
278 NANOSECONDS.convert(-Long.MAX_VALUE / 4, MINUTES)); in testConvertSaturate()
279 assertEquals(Long.MAX_VALUE, in testConvertSaturate()
280 NANOSECONDS.convert(Long.MAX_VALUE / 2, HOURS)); in testConvertSaturate()
[all …]
/libcore/ojluni/src/test/java/time/tck/java/time/
DTCKDuration.java161 Duration.ofSeconds(Long.MAX_VALUE, 1000000000); in factory_seconds_long_long_tooBig()
217 Duration test = Duration.ofNanos(Long.MAX_VALUE); in factory_nanos_max()
218 assertEquals(test.getSeconds(), Long.MAX_VALUE / 1000000000); in factory_nanos_max()
219 assertEquals(test.getNano(), Long.MAX_VALUE % 1000000000); in factory_nanos_max()
224 Duration test = Duration.ofNanos(Long.MIN_VALUE); in factory_nanos_min()
225 assertEquals(test.getSeconds(), Long.MIN_VALUE / 1000000000 - 1); in factory_nanos_min()
226 assertEquals(test.getNano(), Long.MIN_VALUE % 1000000000 + 1000000000); in factory_nanos_min()
241 Duration test = Duration.ofMinutes(Long.MAX_VALUE / 60); in factory_minutes_max()
242 assertEquals(test.getSeconds(), (Long.MAX_VALUE / 60) * 60); in factory_minutes_max()
248 Duration test = Duration.ofMinutes(Long.MIN_VALUE / 60); in factory_minutes_min()
[all …]
/libcore/luni/src/test/java/libcore/java/math/
DBigDecimalTest.java51 String maxLong = Long.toString(Long.MAX_VALUE); in testGetPrecision()
53 String minLong = Long.toString(Long.MIN_VALUE); in testGetPrecision()
135 checkDivide("0", 1, Long.MIN_VALUE, 0, RoundingMode.DOWN); in testDivideRounding()
136 checkDivide("-1", 1, Long.MIN_VALUE, 0, RoundingMode.UP); in testDivideRounding()
137 checkDivide("-1", 1, Long.MIN_VALUE, 0, RoundingMode.FLOOR); in testDivideRounding()
138 checkDivide("0", 1, Long.MIN_VALUE, 0, RoundingMode.CEILING); in testDivideRounding()
139 checkDivide("0", 1, Long.MIN_VALUE, 0, RoundingMode.HALF_EVEN); in testDivideRounding()
140 checkDivide("0", 1, Long.MIN_VALUE, 0, RoundingMode.HALF_UP); in testDivideRounding()
141 checkDivide("0", 1, Long.MIN_VALUE, 0, RoundingMode.HALF_DOWN); in testDivideRounding()
143 checkDivide("1", Long.MAX_VALUE, Long.MAX_VALUE / 2 + 1, 0, RoundingMode.DOWN); in testDivideRounding()
[all …]
/libcore/ojluni/src/main/java/java/util/stream/
DLongPipeline.java57 extends AbstractPipeline<E_IN, Long, LongStream>
68 LongPipeline(Supplier<? extends Spliterator<Long>> source, in LongPipeline()
81 LongPipeline(Spliterator<Long> source, in LongPipeline()
100 private static LongConsumer adapt(Sink<Long> sink) { in adapt()
118 private static Spliterator.OfLong adapt(Spliterator<Long> s) { in adapt()
140 public final <P_IN> Node<Long> evaluateToNode(PipelineHelper<Long> helper, in evaluateToNode()
143 IntFunction<Long[]> generator) { in evaluateToNode()
149 public final <P_IN> Spliterator<Long> wrap(PipelineHelper<Long> ph, in wrap()
158 … public final Spliterator.OfLong lazySpliterator(Supplier<? extends Spliterator<Long>> supplier) { in lazySpliterator()
164 public final void forEachWithCancel(Spliterator<Long> spliterator, Sink<Long> sink) { in forEachWithCancel()
[all …]
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DConcatOpTest.java59 LongStream.range(0, Long.MAX_VALUE / 2).boxed(), in testSize()
60 LongStream.range(0, Long.MAX_VALUE / 2).boxed())); in testSize()
63 LongStream.range(0, Long.MAX_VALUE).boxed(), in testSize()
64 LongStream.range(0, Long.MAX_VALUE).boxed())); in testSize()
67 LongStream.range(0, Long.MAX_VALUE).boxed(), in testSize()
72 LongStream.range(0, Long.MAX_VALUE).boxed())); in testSize()
77 LongStream.range(0, Long.MAX_VALUE / 2), in testLongSize()
78 LongStream.range(0, Long.MAX_VALUE / 2))); in testLongSize()
81 LongStream.range(0, Long.MAX_VALUE), in testLongSize()
82 LongStream.range(0, Long.MAX_VALUE))); in testLongSize()
[all …]
DRangeTest.java192 long[] inc = LongStream.rangeClosed(Long.MAX_VALUE - 1, Long.MAX_VALUE).toArray(); in testLongRange()
194 assertEquals(Long.MAX_VALUE - 1, inc[0]); in testLongRange()
195 assertEquals(Long.MAX_VALUE, inc[1]); in testLongRange()
197 inc = LongStream.rangeClosed(Long.MAX_VALUE, Long.MAX_VALUE).toArray(); in testLongRange()
199 assertEquals(Long.MAX_VALUE, inc[0]); in testLongRange()
202 () -> LongStream.rangeClosed(Long.MAX_VALUE - 8, Long.MAX_VALUE).spliterator()); in testLongRange()
216 terminal(s -> s.reduce(0, Long::sum)).exercise(); in testLongRangeReduce()
222 terminal(s -> s.reduce(0, Long::sum)).exercise(); in testLongInfiniteRangeLimit()
244 Spliterator.OfLong s = LongStream.range(Long.MIN_VALUE, Long.MAX_VALUE).spliterator(); in testLongLongRange()
246 assertEquals(s.estimateSize(), Long.MAX_VALUE); in testLongLongRange()
[all …]
/libcore/ojluni/src/main/java/java/lang/
DLong.java55 public final class Long extends Number implements Comparable<Long> { class
75 public static final Class<Long> TYPE = (Class<Long>) Class.getPrimitiveClass("long");
355 int mag = Long.SIZE - Long.numberOfLeadingZeros(val); in toUnsignedString0()
397 if (i == Long.MIN_VALUE) in toString()
572 long limit = -Long.MAX_VALUE; in parseLong()
581 limit = Long.MIN_VALUE; in parseLong()
780 public static Long valueOf(String s, int radix) throws NumberFormatException { in valueOf()
781 return Long.valueOf(parseLong(s, radix)); in valueOf()
806 public static Long valueOf(String s) throws NumberFormatException in valueOf()
808 return Long.valueOf(parseLong(s, 10)); in valueOf()
[all …]
/libcore/ojluni/annotations/hiddenapi/java/lang/
DLong.java33 public final class Long extends java.lang.Number implements java.lang.Comparable<java.lang.Long> { class
35 public Long(long value) { in Long() method in Long
39 public Long(java.lang.String s) throws java.lang.NumberFormatException { in Long() method in Long
110 public static java.lang.Long valueOf(java.lang.String s, int radix) in valueOf()
115 public static java.lang.Long valueOf(java.lang.String s) in valueOf()
120 public static java.lang.Long valueOf(long l) { in valueOf()
124 public static java.lang.Long decode(java.lang.String nm) in decode()
169 public static java.lang.Long getLong(java.lang.String nm) { in getLong()
173 public static java.lang.Long getLong(java.lang.String nm, long val) { in getLong()
177 public static java.lang.Long getLong(java.lang.String nm, java.lang.Long val) { in getLong()
[all …]
/libcore/ojluni/src/test/java/nio/file/attribute/
DFileTimeTest.java78 cmp(Long.MAX_VALUE, DAYS, Long.MAX_VALUE, NANOSECONDS, 1); in main()
79 cmp(Long.MAX_VALUE, DAYS, Long.MIN_VALUE, NANOSECONDS, 1); in main()
80 cmp(Long.MIN_VALUE, DAYS, Long.MIN_VALUE, NANOSECONDS, -1); in main()
81 cmp(Long.MIN_VALUE, DAYS, Long.MAX_VALUE, NANOSECONDS, -1); in main()
83 cmp(Instant.MIN, Long.MIN_VALUE, DAYS, 1); in main()
84 cmp(Instant.MIN, Long.MIN_VALUE, HOURS, 1); in main()
85 cmp(Instant.MIN, Long.MIN_VALUE, MINUTES, 1); in main()
86 cmp(Instant.MIN, Long.MIN_VALUE, SECONDS, 1); in main()
91 cmp(Instant.MAX, Long.MAX_VALUE, DAYS, -1); in main()
92 cmp(Instant.MAX, Long.MAX_VALUE, HOURS, -1); in main()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
DNumberFormatTest.java42 out = format.format(new Long(Long.MAX_VALUE), new StringBuffer(), pos); in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
47 out = format.format(new Long(Long.MIN_VALUE), new StringBuffer(), pos); in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
53 .valueOf(Long.MAX_VALUE)), new StringBuffer(), pos); in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
59 .valueOf(Long.MIN_VALUE)), new StringBuffer(), pos); in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
65 big = new java.math.BigInteger(String.valueOf(Long.MAX_VALUE)) in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
72 big = new java.math.BigInteger(String.valueOf(Long.MIN_VALUE)) in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
103 format.format(new Long(0), null, pos); in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
110 format.format(new Long(0), new StringBuffer(), null); in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
136 new Long(35), format.parse("35.76")); in test_getIntegerInstance()
139 new Long(35), format.parseObject("35.76")); in test_getIntegerInstance()
[all …]
/libcore/ojluni/annotations/sdk/nullability/java/lang/
DLong.annotated.java33 public final class Long extends java.lang.Number implements java.lang.Comparable<java.lang.Long> { class
35 public Long(long value) { throw new RuntimeException("Stub!"); } in Long() method in Long
37 public Long(@libcore.util.NonNull java.lang.String s) throws java.lang.NumberFormatException { thro… in Long() method in Long
61 @libcore.util.NonNull public static java.lang.Long valueOf(@libcore.util.NonNull java.lang.String s… in valueOf()
63 @libcore.util.NonNull public static java.lang.Long valueOf(@libcore.util.NonNull java.lang.String s… in valueOf()
65 @libcore.util.NonNull public static java.lang.Long valueOf(long l) { throw new RuntimeException("St… in valueOf()
67 @libcore.util.NonNull public static java.lang.Long decode(@libcore.util.NonNull java.lang.String nm… in decode()
89 @libcore.util.Nullable public static java.lang.Long getLong(@libcore.util.NonNull java.lang.String … in getLong()
91 @libcore.util.Nullable public static java.lang.Long getLong(@libcore.util.NonNull java.lang.String … in getLong()
93 …lable public static java.lang.Long getLong(@libcore.util.NonNull java.lang.String nm, @libcore.uti… in getLong()
[all …]
/libcore/ojluni/src/main/java/java/time/format/
DDateTimeTextProvider.java109 …private static final Comparator<Entry<String, Long>> COMPARATOR = new Comparator<Entry<String, Lon…
111 public int compare(Entry<String, Long> obj1, Entry<String, Long> obj2) {
219 …public Iterator<Entry<String, Long>> getTextIterator(TemporalField field, TextStyle style, Locale … in getTextIterator()
244 public Iterator<Entry<String, Long>> getTextIterator(Chronology chrono, TemporalField field, in getTextIterator()
275 List<Entry<String, Long>> list = new ArrayList<>(map.size()); in getTextIterator()
329 Map<TextStyle, Map<Long, String>> styleMap = new HashMap<>(); in createStore()
339 Map<Long, String> map = new HashMap<>(); in createStore()
355 Map<Long, String> map = new HashMap<>(); in createStore()
385 Map<Long, String> map = new HashMap<>(); in createStore()
420 Map<Long, String> map = new HashMap<>(); in createStore()
[all …]
/libcore/ojluni/src/main/java/java/nio/file/attribute/
DFileTime.java147 if (secs == Long.MIN_VALUE || secs == Long.MAX_VALUE) { in to()
154 return (secs < 0) ? Long.MIN_VALUE : Long.MAX_VALUE; in to()
180 return (secs < 0) ? Long.MIN_VALUE : Long.MAX_VALUE; in toMillis()
209 if (d > over) return Long.MAX_VALUE; in scale()
210 if (d < -over) return Long.MIN_VALUE; in scale()
237 Long.MAX_VALUE/SECONDS_PER_DAY); in toInstant()
241 Long.MAX_VALUE/SECONDS_PER_HOUR); in toInstant()
245 Long.MAX_VALUE/SECONDS_PER_MINUTE); in toInstant()
340 return Long.compare(value, other.value); in compareTo()
345 int cmp = Long.compare(secs, secsOther); in compareTo()
[all …]
/libcore/ojluni/src/test/java/time/jdk/testlibrary/
DRandomFactory.java40 private static Long getSystemSeed() { in getSystemSeed()
41 Long seed = null; in getSystemSeed()
46 seed = Long.valueOf(System.getProperty("seed")); in getSystemSeed()
72 Long seed = getSystemSeed(); in getSeed()
/libcore/luni/src/main/java/android/compat/
DCompatibility.java138 private final Set<Long> enabled;
139 private final Set<Long> disabled;
141 public ChangeConfig(Set<Long> enabled, Set<Long> disabled) { in ChangeConfig()
150 Set<Long> intersection = new HashSet<>(enabled); in ChangeConfig()
162 private static long[] toLongArray(Set<Long> values) { in toLongArray()
165 for (Long value: values) { in toLongArray()
179 public Set<Long> forceEnabledSet() { in forceEnabledSet()
183 public Set<Long> forceDisabledSet() { in forceDisabledSet()
/libcore/ojluni/src/test/java/util/stream/boottest/java/util/stream/
DLongNodeTest.java48 List<Node<Long>> nodes = new ArrayList<>(); in createSizes()
56 for (Node<Long> node : nodes) { in createSizes()
65 private static void assertEqualsListLongArray(List<Long> list, long[] array) { in assertEqualsListLongArray()
71 private List<Long> toList(long[] a) { in toList()
72 List<Long> l = new ArrayList<>(); in toList()
80 private long[] toLongArray(List<Long> l) { in toLongArray()
84 for (Long e : l) { in toLongArray()
112 private Node.OfLong tree(List<Long> l, Function<List<Long>, Node.OfLong> m) { in tree() argument
143 List<Long> l = new ArrayList<>((int) n.count()); in testForEach()
172 Node.OfLong slice = n.truncate(start, end, Long[]::new); in testTruncate()
/libcore/luni/src/test/java/libcore/android/system/
DStructTimevalTest.java55 { Long.MAX_VALUE, /* 9223372036854775807 */ in interestingMillisValues()
56 Long.MAX_VALUE / MS_PER_SEC, /* 9223372036854775 */ in interestingMillisValues()
57 (Long.MAX_VALUE % MS_PER_SEC) * US_PER_MS, /* 807000 */ in interestingMillisValues()
61 { Long.MIN_VALUE, /* -9223372036854775808 */ in interestingMillisValues()
62 (Long.MIN_VALUE / MS_PER_SEC) - 1L, /* -9223372036854776 */ in interestingMillisValues()
63 US_PER_SEC - (-(Long.MIN_VALUE % MS_PER_SEC) * US_PER_MS), /* 192000 */ in interestingMillisValues()
/libcore/ojluni/src/test/java/time/test/java/time/
DTestInstant.java82 {"Long.MAX_VALUE", Long.MAX_VALUE}, in provider_sampleEpochMillis()
83 {"Long.MAX_VALUE-1", Long.MAX_VALUE - 1}, in provider_sampleEpochMillis()
87 {"Long.MIN_VALUE+1", Long.MIN_VALUE + 1}, in provider_sampleEpochMillis()
88 {"Long.MIN_VALUE", Long.MIN_VALUE} in provider_sampleEpochMillis()
/libcore/luni/src/test/java/libcore/java/util/
DDateTest.java99 check_convertFromAndToInstant_milliseconds(Long.MIN_VALUE); in test_convertFromAndToInstant_milliseconds()
100 check_convertFromAndToInstant_milliseconds(Long.MAX_VALUE); in test_convertFromAndToInstant_milliseconds()
124 assertEquals(-808, Long.MIN_VALUE % 1000); in test_convertFromInstant_secondsAndNanos()
125 assertEquals(807, Long.MAX_VALUE % 1000); in test_convertFromInstant_secondsAndNanos()
128 long minSecond = Long.MIN_VALUE / 1000; in test_convertFromInstant_secondsAndNanos()
137 long maxSecond = Long.MAX_VALUE / 1000; in test_convertFromInstant_secondsAndNanos()
168 check_convertToInstantAndBack(Long.MIN_VALUE + 808); // minimum ofEpochMilli argument in test_convertToInstantAndBack()
169 check_convertToInstantAndBack(Long.MAX_VALUE); in test_convertToInstantAndBack()

12345678910>>...14