Home
last modified time | relevance | path

Searched refs:field (Results 1 – 25 of 149) sorted by relevance

123456

/libcore/ojluni/src/test/java/time/test/java/time/temporal/
DMockFieldValue.java73 private final TemporalField field; field in MockFieldValue
76 public MockFieldValue(TemporalField field, long value) { in MockFieldValue() argument
77 this.field = field; in MockFieldValue()
82 public boolean isSupported(TemporalField field) { in isSupported() argument
83 return field != null && field.equals(this.field); in isSupported()
87 public ValueRange range(TemporalField field) { in range() argument
88 if (field instanceof ChronoField) { in range()
89 if (isSupported(field)) { in range()
90 return field.range(); in range()
92 throw new UnsupportedTemporalTypeException("Unsupported field: " + field); in range()
[all …]
DTestDateTimeBuilderCombinations.java113 public boolean isSupported(TemporalField field) { in test_derive()
114 return field == field1 || field == field2 || field == field3 || field == field4; in test_derive()
117 public long getLong(TemporalField field) { in test_derive()
118 if (field == field1) { in test_derive()
121 if (field == field2) { in test_derive()
124 if (field == field3) { in test_derive()
127 if (field == field4) { in test_derive()
190 public boolean isSupported(TemporalField field) { in test_normalized()
191 return field == field1; in test_normalized()
194 public long getLong(TemporalField field) { in test_normalized()
[all …]
/libcore/libart/src/main/java/java/lang/invoke/
DFieldVarHandle.java29 private FieldVarHandle(Field field, Class<?> declaringClass) { in FieldVarHandle() argument
30 super(field.getType(), Modifier.isFinal(field.getModifiers()), declaringClass); in FieldVarHandle()
31 artField = field.getArtField(); in FieldVarHandle()
34 private FieldVarHandle(Field field) { in FieldVarHandle() argument
35 super(field.getType(), Modifier.isFinal(field.getModifiers())); in FieldVarHandle()
36 artField = field.getArtField(); in FieldVarHandle()
39 static FieldVarHandle create(Field field) { in create() argument
40 if (Modifier.isStatic(field.getModifiers())) { in create()
41 return new FieldVarHandle(field); in create()
43 return new FieldVarHandle(field, field.getDeclaringClass()); in create()
/libcore/ojluni/src/main/java/java/time/temporal/
DTemporalAccessor.java126 boolean isSupported(TemporalField field); in isSupported() argument
169 default ValueRange range(TemporalField field) { in range() argument
170 if (field instanceof ChronoField) { in range()
171 if (isSupported(field)) { in range()
172 return field.range(); in range()
174 throw new UnsupportedTemporalTypeException("Unsupported field: " + field); in range()
176 Objects.requireNonNull(field, "field"); in range()
177 return field.rangeRefinedBy(this); in range()
217 default int get(TemporalField field) { in get() argument
218 ValueRange range = range(field); in get()
[all …]
/libcore/ojluni/src/main/java/java/security/spec/
DEllipticCurve.java45 private final ECField field; field in EllipticCurve
51 private static void checkValidity(ECField field, BigInteger c, in checkValidity() argument
54 if (field instanceof ECFieldFp) { in checkValidity()
55 BigInteger p = ((ECFieldFp)field).getP(); in checkValidity()
61 } else if (field instanceof ECFieldF2m) { in checkValidity()
62 int m = ((ECFieldF2m)field).getM(); in checkValidity()
81 public EllipticCurve(ECField field, BigInteger a, in EllipticCurve() argument
83 this(field, a, b, null); in EllipticCurve()
101 public EllipticCurve(ECField field, BigInteger a, in EllipticCurve() argument
103 if (field == null) { in EllipticCurve()
[all …]
/libcore/ojluni/src/test/java/time/tck/java/time/
DAbstractDateTimeTest.java103 for (TemporalField field : validFields()) { in basicTest_isSupported_TemporalField_supported()
104 assertEquals(sample.isSupported(field), true, "Failed on " + sample + " " + field); in basicTest_isSupported_TemporalField_supported() local
112 for (TemporalField field : invalidFields()) { in basicTest_isSupported_TemporalField_unsupported()
113 assertEquals(sample.isSupported(field), false, "Failed on " + sample + " " + field); in basicTest_isSupported_TemporalField_unsupported() local
131 for (TemporalField field : validFields()) { in basicTest_range_TemporalField_supported()
132 sample.range(field); // no exception in basicTest_range_TemporalField_supported()
140 for (TemporalField field : invalidFields()) { in basicTest_range_TemporalField_unsupported()
142 sample.range(field); in basicTest_range_TemporalField_unsupported()
143 fail("Failed on " + sample + " " + field); in basicTest_range_TemporalField_unsupported()
169 for (TemporalField field : validFields()) { in basicTest_get_TemporalField_supported()
[all …]
/libcore/ojluni/src/main/java/java/time/chrono/
DEra.java145 default boolean isSupported(TemporalField field) { in isSupported() argument
146 if (field instanceof ChronoField) { in isSupported()
147 return field == ERA; in isSupported()
149 return field != null && field.isSupportedBy(this); in isSupported()
178 default ValueRange range(TemporalField field) { in range() argument
179 return TemporalAccessor.super.range(field); in range()
208 default int get(TemporalField field) { in get() argument
209 if (field == ERA) { in get()
212 return TemporalAccessor.super.get(field); in get()
238 default long getLong(TemporalField field) { in getLong() argument
[all …]
DChronoLocalDateTimeImpl.java239 public boolean isSupported(TemporalField field) { in isSupported() argument
240 if (field instanceof ChronoField) { in isSupported()
241 ChronoField f = (ChronoField) field; in isSupported()
244 return field != null && field.isSupportedBy(this); in isSupported()
248 public ValueRange range(TemporalField field) { in range() argument
249 if (field instanceof ChronoField) { in range()
250 ChronoField f = (ChronoField) field; in range()
251 return (f.isTimeBased() ? time.range(field) : date.range(field)); in range()
253 return field.rangeRefinedBy(this); in range()
257 public int get(TemporalField field) { in get() argument
[all …]
DChronoZonedDateTime.java179 default ValueRange range(TemporalField field) { in range() argument
180 if (field instanceof ChronoField) { in range()
181 if (field == INSTANT_SECONDS || field == OFFSET_SECONDS) { in range()
182 return field.range(); in range()
184 return toLocalDateTime().range(field); in range()
186 return field.rangeRefinedBy(this); in range()
190 default int get(TemporalField field) { in get() argument
191 if (field instanceof ChronoField) { in get()
192 switch ((ChronoField) field) { in get()
198 return toLocalDateTime().get(field); in get()
[all …]
/libcore/ojluni/src/main/java/java/text/
DCalendarBuilder.java58 private final int[] field; field in CalendarBuilder
63 field = new int[MAX_FIELD * 2]; in CalendarBuilder()
73 field[index] = nextStamp++; in set()
74 field[MAX_FIELD + index] = value; in set()
82 field[MAX_FIELD + YEAR] += value; in addYear()
83 field[MAX_FIELD + WEEK_YEAR] += value; in addYear()
91 return field[index] > UNSET; in isSet()
98 field[index] = UNSET; in clear()
99 field[MAX_FIELD + index] = 0; in clear()
105 && field[WEEK_YEAR] > field[YEAR]; in establish()
[all …]
DFieldPosition.java79 int field = 0; field in FieldPosition
109 public FieldPosition(int field) { in FieldPosition() argument
110 this.field = field; in FieldPosition()
144 this.field = fieldID; in FieldPosition()
165 return field; in getField()
236 && field == other.field); in equals()
244 return (field << 24) | (beginIndex << 16) | endIndex; in hashCode()
253 "[field=" + field + ",attribute=" + attribute + in toString()
275 private boolean matchesField(Format.Field attribute, int field) { in matchesField() argument
279 return (field == this.field); in matchesField()
/libcore/ojluni/src/main/java/java/time/
DDayOfWeek.java251 public boolean isSupported(TemporalField field) { in isSupported() argument
252 if (field instanceof ChronoField) { in isSupported()
253 return field == DAY_OF_WEEK; in isSupported()
255 return field != null && field.isSupportedBy(this); in isSupported()
281 public ValueRange range(TemporalField field) { in range() argument
282 if (field == DAY_OF_WEEK) { in range()
283 return field.range(); in range()
285 return TemporalAccessor.super.range(field); in range()
314 public int get(TemporalField field) { in get() argument
315 if (field == DAY_OF_WEEK) { in get()
[all …]
DMonth.java278 public boolean isSupported(TemporalField field) { in isSupported() argument
279 if (field instanceof ChronoField) { in isSupported()
280 return field == MONTH_OF_YEAR; in isSupported()
282 return field != null && field.isSupportedBy(this); in isSupported()
308 public ValueRange range(TemporalField field) { in range() argument
309 if (field == MONTH_OF_YEAR) { in range()
310 return field.range(); in range()
312 return TemporalAccessor.super.range(field); in range()
341 public int get(TemporalField field) { in get() argument
342 if (field == MONTH_OF_YEAR) { in get()
[all …]
DMonthDay.java343 public boolean isSupported(TemporalField field) { in isSupported() argument
344 if (field instanceof ChronoField) { in isSupported()
345 return field == MONTH_OF_YEAR || field == DAY_OF_MONTH; in isSupported()
347 return field != null && field.isSupportedBy(this); in isSupported()
374 public ValueRange range(TemporalField field) { in range() argument
375 if (field == MONTH_OF_YEAR) { in range()
376 return field.range(); in range()
377 } else if (field == DAY_OF_MONTH) { in range()
380 return TemporalAccessor.super.range(field); in range()
410 public int get(TemporalField field) { in get() argument
[all …]
DYear.java362 public boolean isSupported(TemporalField field) { in isSupported() argument
363 if (field instanceof ChronoField) { in isSupported()
364 return field == YEAR || field == YEAR_OF_ERA || field == ERA; in isSupported()
366 return field != null && field.isSupportedBy(this); in isSupported()
428 public ValueRange range(TemporalField field) { in range() argument
429 if (field == YEAR_OF_ERA) { in range()
432 return Temporal.super.range(field); in range()
462 public int get(TemporalField field) { in get() argument
463 return range(field).checkValidIntValue(getLong(field), field); in get()
490 public long getLong(TemporalField field) { in getLong() argument
[all …]
DZoneOffset.java523 public boolean isSupported(TemporalField field) {
524 if (field instanceof ChronoField) {
525 return field == OFFSET_SECONDS;
527 return field != null && field.isSupportedBy(this);
554 public ValueRange range(TemporalField field) {
555 return TemporalAccessor.super.range(field);
584 public int get(TemporalField field) {
585 if (field == OFFSET_SECONDS) {
587 } else if (field instanceof ChronoField) {
588 throw new UnsupportedTemporalTypeException("Unsupported field: " + field);
[all …]
/libcore/ojluni/src/test/java/time/test/java/time/
DAbstractTest.java89 for (Field field : fields) { in assertImmutable()
90 if (field.getName().contains("$") == false) { in assertImmutable()
91 if (Modifier.isStatic(field.getModifiers())) { in assertImmutable()
92 assertTrue(Modifier.isFinal(field.getModifiers()), "Field:" + field.getName()); in assertImmutable()
94 … assertTrue(Modifier.isPrivate(field.getModifiers()), "Field:" + field.getName()); in assertImmutable()
95 assertTrue(Modifier.isFinal(field.getModifiers()), "Field:" + field.getName()); in assertImmutable()
/libcore/luni/src/test/java/libcore/java/time/
DZoneOffsetTest.java38 for (ChronoField field : ChronoField.values()) { in test_isSupported()
40 assertEquals("isSupported(" + field + ")", in test_isSupported()
41 field == ChronoField.OFFSET_SECONDS, OFFSET_P1.isSupported(field)); in test_isSupported()
58 for (ChronoField field : ChronoField.values()) { in test_range_unsupported()
60 if (field == ChronoField.OFFSET_SECONDS) { in test_range_unsupported()
64 OFFSET_P1.range(field); in test_range_unsupported()
65 fail("ZoneOffset.range(" + field + ") should have failed."); in test_range_unsupported()
/libcore/ojluni/src/main/java/sun/util/locale/provider/
DCalendarDataUtility.java103 public static String retrieveFieldValueName(String id, int field, int value, int style, in retrieveFieldValueName() argument
105 if (field == Calendar.ERA) { in retrieveFieldValueName()
127 String[] names = getNames(id, field, style, locale); in retrieveFieldValueName()
150 public static String retrieveJavaTimeFieldValueName(String id, int field, int value, int style, in retrieveJavaTimeFieldValueName() argument
153 return retrieveFieldValueName(id, field, value, style, locale); in retrieveJavaTimeFieldValueName()
166 public static Map<String, Integer> retrieveFieldValueNames(String id, int field, int style, in retrieveFieldValueNames() argument
170 names = retrieveFieldValueNamesImpl(id, field, SHORT_FORMAT, locale); in retrieveFieldValueNames()
172 names.putAll(retrieveFieldValueNamesImpl(id, field, st, locale)); in retrieveFieldValueNames()
176 names = retrieveFieldValueNamesImpl(id, field, style, locale); in retrieveFieldValueNames()
197 public static Map<String, Integer> retrieveJavaTimeFieldValueNames(String id, int field, in retrieveJavaTimeFieldValueNames() argument
[all …]
/libcore/ojluni/src/main/java/java/util/
DCalendar.java1151 public Builder set(int field, int value) { in set() argument
1153 if (field < 0 || field >= FIELD_COUNT) { in set()
1160 internalSet(field, value); in set()
1202 int field = fieldValuePairs[i++]; in setFields() local
1204 if (field < 0 || field >= FIELD_COUNT) { in setFields()
1207 internalSet(field, fieldValuePairs[i++]); in setFields()
1554 private void internalSet(int field, int value) { in internalSet() argument
1555 fields[field] = nextStamp++; in internalSet()
1559 fields[NFIELDS + field] = value; in internalSet()
1560 if (field > maxFieldIndex && field < WEEK_YEAR) { in internalSet()
[all …]
/libcore/ojluni/src/test/java/time/tck/java/time/temporal/
DTCKJulianFields.java128 public void test_samples_get(TemporalField field, LocalDate date, long expected) { in test_samples_get() argument
129 assertEquals(date.getLong(field), expected); in test_samples_get()
133 public void test_samples_set(TemporalField field, LocalDate date, long value) { in test_samples_set() argument
134 assertEquals(field.adjustInto(LocalDate.MAX, value), date); in test_samples_set()
135 assertEquals(field.adjustInto(LocalDate.MIN, value), date); in test_samples_set()
136 assertEquals(field.adjustInto(JAN01_1970, value), date); in test_samples_set()
137 assertEquals(field.adjustInto(DEC31_1969, value), date); in test_samples_set()
138 assertEquals(field.adjustInto(NOV12_1945, value), date); in test_samples_set()
143 public void test_samples_parse_STRICT(TemporalField field, LocalDate date, long value) { in test_samples_parse_STRICT() argument
144 DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(field) in test_samples_parse_STRICT()
[all …]
/libcore/ojluni/src/main/java/java/time/format/
DDateTimePrintContext.java187 public boolean isSupported(TemporalField field) { in adjust()
188 if (effectiveDate != null && field.isDateBased()) { in adjust()
189 return effectiveDate.isSupported(field); in adjust()
191 return temporal.isSupported(field); in adjust()
194 public ValueRange range(TemporalField field) { in adjust() argument
195 if (effectiveDate != null && field.isDateBased()) { in adjust()
196 return effectiveDate.range(field); in adjust()
198 return temporal.range(field); in adjust()
201 public long getLong(TemporalField field) { in adjust() argument
202 if (effectiveDate != null && field.isDateBased()) { in adjust()
[all …]
/libcore/luni/src/test/java/libcore/java/text/
DOldNumberFormatFieldTest.java32 MyNumberFormat field = new MyNumberFormat(name); in test_ConstructorLjava_lang_String() local
33 assertEquals("field has wrong name", name, field.getName()); in test_ConstructorLjava_lang_String()
35 field = new MyNumberFormat(null); in test_ConstructorLjava_lang_String()
36 assertEquals("field has wrong name", null, field.getName()); in test_ConstructorLjava_lang_String()
48 MyNumberFormat field; in test_readResolve() local
52 field = new MyNumberFormat(null); in test_readResolve()
55 out.writeObject(field); in test_readResolve()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
DDataFormatFieldTest.java37 MyField field = new MyField("day of month", Calendar.ERA); in test_ConstructorLjava_lang_StringLjava_lang_String() local
39 assertEquals("field has wrong name", "day of month", field.getName()); in test_ConstructorLjava_lang_StringLjava_lang_String()
41 field.getCalendarField()); in test_ConstructorLjava_lang_StringLjava_lang_String()
70 MyField field = new MyField("a field", Calendar.DAY_OF_WEEK); in test_ConstructorLjava_lang_StringI() local
72 assertEquals("field has wrong name", "a field", field.getName()); in test_ConstructorLjava_lang_StringI()
74 Calendar.DAY_OF_WEEK, field.getCalendarField()); in test_ConstructorLjava_lang_StringI()
86 MyField field = new MyField("day of month", Calendar.ERA); in test_Constructor2() local
88 assertEquals("field has wrong name", "day of month", field.getName()); in test_Constructor2()
90 field.getCalendarField()); in test_Constructor2()
182 MyField field; in test_readResolve() local
[all …]
/libcore/ojluni/annotations/hiddenapi/java/util/
DCalendar.java109 public int get(int field) { in get() argument
113 protected final int internalGet(int field) { in internalGet() argument
117 final void internalSet(int field, int value) { in internalSet() argument
121 public void set(int field, int value) { in set() argument
141 public final void clear(int field) { in clear() argument
145 public final boolean isSet(int field) { in isSet() argument
149 public java.lang.String getDisplayName(int field, int style, java.util.Locale locale) { in getDisplayName() argument
154 int field, int style, java.util.Locale locale) { in getDisplayNames() argument
159 int field, int style, java.util.Locale locale) { in getDisplayNamesImpl() argument
164 int field, in checkDisplayNameParams() argument
[all …]

123456