Searched refs:getLong (Results 1 - 25 of 114) sorted by relevance

12345

/libcore/luni/src/test/java/libcore/java/time/chrono/
H A DHijrahChronologyTest.java43 assertEquals(1300, date.getLong(ChronoField.YEAR_OF_ERA));
44 assertEquals(1300, date.getLong(ChronoField.YEAR));
45 assertEquals(2, date.getLong(ChronoField.MONTH_OF_YEAR));
47 assertEquals(1300 * 12 + 2 - 1, date.getLong(ChronoField.PROLEPTIC_MONTH));
48 assertEquals(5, date.getLong(ChronoField.DAY_OF_MONTH));
50 assertEquals(30 + 5, date.getLong(ChronoField.DAY_OF_YEAR));
51 assertEquals(date.toEpochDay(), date.getLong(ChronoField.EPOCH_DAY));
H A DMinguoChronologyTest.java114 assertEquals(10, date.getLong(ChronoField.YEAR_OF_ERA));
115 assertEquals(10, date.getLong(ChronoField.YEAR));
116 assertEquals(2, date.getLong(ChronoField.MONTH_OF_YEAR));
117 assertEquals(10*12 + 2 - 1, date.getLong(ChronoField.PROLEPTIC_MONTH));
118 assertEquals(5, date.getLong(ChronoField.DAY_OF_MONTH));
119 assertEquals(31 + 5, date.getLong(ChronoField.DAY_OF_YEAR));
120 assertEquals(date.toEpochDay(), date.getLong(ChronoField.EPOCH_DAY));
H A DThaiBuddhistChronologyTest.java116 assertEquals(10, date.getLong(ChronoField.YEAR_OF_ERA));
117 assertEquals(10, date.getLong(ChronoField.YEAR));
118 assertEquals(2, date.getLong(ChronoField.MONTH_OF_YEAR));
119 assertEquals(10 * 12 + 2 - 1, date.getLong(ChronoField.PROLEPTIC_MONTH));
120 assertEquals(5, date.getLong(ChronoField.DAY_OF_MONTH));
121 assertEquals(31 + 5, date.getLong(ChronoField.DAY_OF_YEAR));
122 assertEquals(date.toEpochDay(), date.getLong(ChronoField.EPOCH_DAY));
/libcore/ojluni/src/main/java/java/time/temporal/
H A DTemporalAccessor.java204 * return range(field).checkValidIntValue(getLong(field), field);
206 * throw new UnsupportedTemporalTypeException("Invalid field " + field + " + for get() method, use getLong() instead");
220 throw new UnsupportedTemporalTypeException("Invalid field " + field + " for get() method, use getLong() instead");
222 long value = getLong(field);
255 long getLong(TemporalField field); method in interface:TemporalAccessor
H A DTemporalQueries.java383 return LocalDate.ofEpochDay(temporal.getLong(EPOCH_DAY));
393 return LocalTime.ofNanoOfDay(temporal.getLong(NANO_OF_DAY));
H A DIsoFields.java313 long qoy = temporal.getLong(QUARTER_OF_YEAR);
315 long year = temporal.getLong(YEAR);
331 long year = temporal.getLong(YEAR);
340 return (R) temporal.with(DAY_OF_YEAR, temporal.getLong(DAY_OF_YEAR) + (newValue - curValue));
401 long moy = temporal.getLong(MONTH_OF_YEAR);
410 return (R) temporal.with(MONTH_OF_YEAR, temporal.getLong(MONTH_OF_YEAR) + (newValue - curValue) * 3);
711 return Math.subtractExact(temporal2Exclusive.getLong(WEEK_BASED_YEAR),
712 temporal1Inclusive.getLong(WEEK_BASED_YEAR));
/libcore/ojluni/src/test/java/time/tck/java/time/format/
H A DTCKDateTimeFormatterBuilder.java744 assertEquals(parsed.getLong(HOUR_OF_DAY), 12L);
745 assertEquals(parsed.getLong(MINUTE_OF_HOUR), 30L);
756 assertEquals(parsed.getLong(HOUR_OF_DAY), 123L);
757 assertEquals(parsed.getLong(MINUTE_OF_HOUR), 9L);
778 assertEquals(parsed.getLong(HOUR_OF_DAY), 12L);
779 assertEquals(parsed.getLong(MINUTE_OF_HOUR), 30L);
790 assertEquals(parsed.getLong(HOUR_OF_DAY), 123L);
791 assertEquals(parsed.getLong(MINUTE_OF_HOUR), 9L);
813 assertEquals(parsed.getLong(HOUR_OF_DAY), 12L);
814 assertEquals(parsed.getLong(MINUTE_OF_HOU
[all...]
H A DTCKDateTimeParseResolver.java160 assertEquals(accessor.getLong(field1), value1);
200 assertEquals(accessor.getLong(field1), value1);
201 assertEquals(accessor.getLong(field2), value2);
233 assertEquals(accessor.getLong(field1), value1);
234 assertEquals(accessor.getLong(field2), value2);
235 assertEquals(accessor.getLong(field3), value3);
266 assertEquals(accessor.getLong(expectedField1), expectedValue1.longValue());
270 assertEquals(accessor.getLong(expectedField2), expectedValue2.longValue());
348 assertEquals(accessor.getLong(expectedField1), expectedValue1.longValue());
352 assertEquals(accessor.getLong(expectedField
[all...]
H A DTCKPadPrinterParser.java137 assertEquals(parsed.getLong(MONTH_OF_YEAR), expectedMonth.longValue());
178 assertEquals(parsed.getLong(MONTH_OF_YEAR), expectedMonth.longValue());
201 assertEquals(parsed.getLong(MONTH_OF_YEAR), 2L); // +2, not -2
/libcore/ojluni/src/main/java/java/time/chrono/
H A DChronoLocalDateImpl.java209 case ERAS: return with(ERA, Math.addExact(getLong(ERA), amountToAdd));
388 case ERAS: return end.getLong(ERA) - getLong(ERA);
405 long packed1 = getLong(PROLEPTIC_MONTH) * 32L + get(DAY_OF_MONTH); // no overflow
406 long packed2 = end.getLong(PROLEPTIC_MONTH) * 32L + end.get(DAY_OF_MONTH); // no overflow
429 // getLong() reduces chances of exceptions in toString()
430 long yoe = getLong(YEAR_OF_ERA);
431 long moy = getLong(MONTH_OF_YEAR);
432 long dom = getLong(DAY_OF_MONTH);
H A DChronoLocalDateTimeImpl.java262 return range(field).checkValidIntValue(getLong(field), field);
266 public long getLong(TemporalField field) { method in class:ChronoLocalDateTimeImpl
269 return (f.isTimeBased() ? time.getLong(field) : date.getLong(field));
377 long amount = end.getLong(EPOCH_DAY) - date.getLong(EPOCH_DAY);
H A DEra.java238 default long getLong(TemporalField field) { method in interface:Era
/libcore/ojluni/src/test/java/time/test/java/time/format/
H A DTestTextParser.java111 .getLong(DAY_OF_WEEK), 1L);
119 .getLong(DAY_OF_WEEK), 3L);
251 assertEquals(getFormatter(field, style).parseUnresolved(input, pos).getLong(field), (long) value);
258 assertEquals(getFormatter(field, style).parseUnresolved(input, pos).getLong(field), (long) value);
266 assertEquals(formatter.parseUnresolved(input, pos).getLong(field), (long) expectedValue);
295 assertEquals(getFormatter(field, style).parseUnresolved(input.toUpperCase(Locale.ROOT), pos).getLong(field), (long) value);
316 assertEquals(getFormatter(field, style).parseUnresolved(input.toLowerCase(Locale.ROOT), pos).getLong(field), (long) value);
326 assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.FULL).parseUnresolved("January", pos).getLong(MONTH_OF_YEAR), 1L);
348 assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).parseUnresolved("January", pos).getLong(MONTH_OF_YEAR), 1L);
355 assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).parseUnresolved("Janua", pos).getLong(MONTH_OF_YEA
[all...]
H A DTestDateTimeFormatterBuilder.java229 assertEquals(parsed.getLong(MONTH_OF_YEAR), 1L);
230 assertEquals(parsed.getLong(DAY_OF_MONTH), 23L);
239 assertEquals(parsed.getLong(MONTH_OF_YEAR), 1L);
240 assertEquals(parsed.getLong(DAY_OF_MONTH), 23L);
249 assertEquals(parsed.getLong(MONTH_OF_YEAR), 1L);
250 assertEquals(parsed.getLong(DAY_OF_MONTH), 23L);
262 assertEquals(parsed.getLong(YEAR), 2009L);
263 assertEquals(parsed.getLong(MONTH_OF_YEAR), 6L);
264 assertEquals(parsed.getLong(DAY_OF_MONTH), 30L);
279 assertEquals(parsed.getLong(YEA
[all...]
/libcore/ojluni/src/test/java/time/tck/java/time/
H A DAbstractDateTimeTest.java218 // getLong(TemporalField)
224 sample.getLong(field); // no exception
234 sample.getLong(field);
246 sample.getLong(MockFieldNoValue.INSTANCE);
254 sample.getLong(null);
/libcore/ojluni/src/test/java/time/test/java/time/temporal/
H A DMockFieldValue.java98 public long getLong(TemporalField field) { method in class:MockFieldValue
H A DTestDateTimeBuilderCombinations.java117 public long getLong(TemporalField field) {
194 public long getLong(TemporalField field) {
205 assertEquals(temporal.getLong(expectedField), expectedVal.longValue());
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/
H A DCopticDate.java211 public long getLong(TemporalField field) { method in class:CopticDate
240 case ALIGNED_DAY_OF_WEEK_IN_MONTH: return plusDays(newValue - getLong(ALIGNED_DAY_OF_WEEK_IN_MONTH));
241 case ALIGNED_DAY_OF_WEEK_IN_YEAR: return plusDays(newValue - getLong(ALIGNED_DAY_OF_WEEK_IN_YEAR));
245 case ALIGNED_WEEK_OF_MONTH: return plusDays((newValue - getLong(ALIGNED_WEEK_OF_MONTH)) * 7);
246 case ALIGNED_WEEK_OF_YEAR: return plusDays((newValue - getLong(ALIGNED_WEEK_OF_YEAR)) * 7);
337 // getLong() reduces chances of exceptions in toString()
338 long yoe = getLong(YEAR_OF_ERA);
339 long moy = getLong(MONTH_OF_YEAR);
340 long dom = getLong(DAY_OF_MONTH);
/libcore/luni/src/test/java/libcore/java/lang/reflect/
H A DArrayTest.java117 try { Array.getLong(booleans, 0); fail(); } catch (IllegalArgumentException expected) {}
118 assertEquals((long) bytes[0], Array.getLong(bytes, 0));
119 assertEquals((long) chars[0], Array.getLong(chars, 0));
120 try { Array.getLong(doubles, 0); fail(); } catch (IllegalArgumentException expected) {}
121 try { Array.getLong(floats, 0); fail(); } catch (IllegalArgumentException expected) {}
122 assertEquals((long) ints[0], Array.getLong(ints, 0));
123 assertEquals(longs[0], Array.getLong(longs, 0));
124 assertEquals((long) shorts[0], Array.getLong(shorts, 0));
125 try { Array.getLong(null, 0); fail(); } catch (NullPointerException expected) {}
H A DFieldTest.java30 assertEquals(5073258162644648461L, field.getLong(null));
/libcore/ojluni/src/main/java/sun/nio/ch/
H A DNativeObject.java127 newAddress = unsafe.getLong(offset + address);
283 final long getLong(int offset) { method in class:NativeObject
284 return unsafe.getLong(offset + address);
/libcore/ojluni/src/main/java/java/io/
H A DBits.java64 static long getLong(byte[] b, int off) { method in class:Bits
76 return Double.longBitsToDouble(getLong(b, off));
/libcore/ojluni/src/main/java/java/time/format/
H A DDateTimePrintContext.java201 public long getLong(TemporalField field) {
203 return effectiveDate.getLong(field);
205 return temporal.getLong(field);
298 return temporal.getLong(field);
/libcore/ojluni/src/main/java/java/time/
H A DYear.java463 return range(field).checkValidIntValue(getLong(field), field);
490 public long getLong(TemporalField field) { method in class:Year
620 case ERA: return (getLong(ERA) == newValue ? this : Year.of(1 - year));
709 case ERAS: return with(ERA, Math.addExact(getLong(ERA), amountToAdd));
916 case ERAS: return end.getLong(ERA) - getLong(ERA);
H A DYearMonth.java452 return range(field).checkValidIntValue(getLong(field), field);
479 public long getLong(TemporalField field) { method in class:YearMonth
685 case ERA: return (getLong(ERA) == newValue ? this : withYear(1 - year));
807 case ERAS: return with(ERA, Math.addExact(getLong(ERA), amountToAdd));
1049 case ERAS: return end.getLong(ERA) - getLong(ERA);

Completed in 334 milliseconds

12345