コード例 #1
0
 @Override
 public ValueRange range(TemporalField field) {
   if (field == ERA) {
     return field.range();
   } else if (field instanceof ChronoField) {
     throw new UnsupportedTemporalTypeException("Unsupported field: " + field);
   }
   return field.rangeRefinedBy(this);
 }
コード例 #2
0
 // -----------------------------------------------------------------------
 @Override
 public boolean isSupported(TemporalField field) {
   if (field instanceof ChronoField) {
     return field == ERA;
   }
   return field != null && field.isSupportedBy(this);
 }
コード例 #3
0
 @Override
 public long getLong(TemporalField field) {
   if (field == ERA) {
     return getValue();
   } else if (field instanceof ChronoField) {
     throw new UnsupportedTemporalTypeException("Unsupported field: " + field);
   }
   return field.getFrom(this);
 }