src/share/classes/java/time/temporal/WeekFields.java

Print this page




 860                     result.put(weekDef.weekOfWeekBasedYear, null);
 861                     result.put(weekDef.weekBasedYear, null);
 862                     return result;
 863                 }
 864             }
 865             return null;
 866         }
 867 
 868         //-----------------------------------------------------------------------
 869         @Override
 870         public String getName() {
 871             return name;
 872         }
 873 
 874         @Override
 875         public String getDisplayName(Locale locale) {
 876             Objects.requireNonNull(locale, "locale");
 877             if (rangeUnit == YEARS) {  // only have values for week-of-year
 878                 LocaleResources lr = LocaleProviderAdapter.getResourceBundleBased()
 879                         .getLocaleResources(locale);
 880                 ResourceBundle rb = lr.getFormatData();
 881                 return rb.containsKey("field.week") ? rb.getString("field.week") : getName();
 882             }
 883             return getName();
 884         }
 885 
 886         @Override
 887         public TemporalUnit getBaseUnit() {
 888             return baseUnit;
 889         }
 890 
 891         @Override
 892         public TemporalUnit getRangeUnit() {
 893             return rangeUnit;
 894         }
 895 
 896         @Override
 897         public boolean isDateBased() {
 898             return true;
 899         }
 900 




 860                     result.put(weekDef.weekOfWeekBasedYear, null);
 861                     result.put(weekDef.weekBasedYear, null);
 862                     return result;
 863                 }
 864             }
 865             return null;
 866         }
 867 
 868         //-----------------------------------------------------------------------
 869         @Override
 870         public String getName() {
 871             return name;
 872         }
 873 
 874         @Override
 875         public String getDisplayName(Locale locale) {
 876             Objects.requireNonNull(locale, "locale");
 877             if (rangeUnit == YEARS) {  // only have values for week-of-year
 878                 LocaleResources lr = LocaleProviderAdapter.getResourceBundleBased()
 879                         .getLocaleResources(locale);
 880                 ResourceBundle rb = lr.getJavaTimeFormatData();
 881                 return rb.containsKey("field.week") ? rb.getString("field.week") : getName();
 882             }
 883             return getName();
 884         }
 885 
 886         @Override
 887         public TemporalUnit getBaseUnit() {
 888             return baseUnit;
 889         }
 890 
 891         @Override
 892         public TemporalUnit getRangeUnit() {
 893             return rangeUnit;
 894         }
 895 
 896         @Override
 897         public boolean isDateBased() {
 898             return true;
 899         }
 900