Lines Matching defs:field

126      * Checks if the specified field is supported.
128 * This checks if this era can be queried for the specified field.
132 * If the field is a {@link ChronoField} then the query is implemented here.
133 * The {@code ERA} field returns true.
136 * If the field is not a {@code ChronoField}, then the result of this method
139 * Whether the field is supported is determined by the field.
141 * @param field the field to check, null returns false
142 * @return true if the field is supported on this era, false if not
145 default boolean isSupported(TemporalField field) {
146 if (field instanceof ChronoField) {
147 return field == ERA;
149 return field != null && field.isSupportedBy(this);
153 * Gets the range of valid values for the specified field.
155 * The range object expresses the minimum and maximum valid values for a field.
157 * If it is not possible to return the range, because the field is not supported
160 * If the field is a {@link ChronoField} then the query is implemented here.
161 * The {@code ERA} field returns the range.
164 * If the field is not a {@code ChronoField}, then the result of this method
167 * Whether the range can be obtained is determined by the field.
172 * @param field the field to query the range for, not null
173 * @return the range of valid values for the field, not null
174 * @throws DateTimeException if the range for the field cannot be obtained
178 default ValueRange range(TemporalField field) {
179 return TemporalAccessor.super.range(field);
183 * Gets the value of the specified field from this era as an {@code int}.
185 * This queries this era for the value of the specified field.
186 * The returned value will always be within the valid range of values for the field.
187 * If it is not possible to return the value, because the field is not supported
190 * If the field is a {@link ChronoField} then the query is implemented here.
191 * The {@code ERA} field returns the value of the era.
194 * If the field is not a {@code ChronoField}, then the result of this method
197 * and what the value represents, is determined by the field.
199 * @param field the field to get, not null
200 * @return the value for the field
201 * @throws DateTimeException if a value for the field cannot be obtained or
202 * the value is outside the range of valid values for the field
203 * @throws UnsupportedTemporalTypeException if the field is not supported or
208 default int get(TemporalField field) {
209 if (field == ERA) {
212 return TemporalAccessor.super.get(field);
216 * Gets the value of the specified field from this era as a {@code long}.
218 * This queries this era for the value of the specified field.
219 * If it is not possible to return the value, because the field is not supported
222 * If the field is a {@link ChronoField} then the query is implemented here.
223 * The {@code ERA} field returns the value of the era.
226 * If the field is not a {@code ChronoField}, then the result of this method
229 * and what the value represents, is determined by the field.
231 * @param field the field to get, not null
232 * @return the value for the field
233 * @throws DateTimeException if a value for the field cannot be obtained
234 * @throws UnsupportedTemporalTypeException if the field is not supported
238 default long getLong(TemporalField field) {
239 if (field == ERA) {
241 } else if (field instanceof ChronoField) {
242 throw new UnsupportedTemporalTypeException("Unsupported field: " + field);
244 return field.getFrom(this);
282 * passing {@link ChronoField#ERA} as the field.