src/java.base/share/classes/sun/util/locale/provider/NumberFormatProviderImpl.java
Print this page
rev 10528 : 8038436: Re-examine the mechanism to determine available localedata and cldrdata
Reviewed-by:
*** 1,7 ****
/*
! * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 63,77 ****
private static final int PERCENTSTYLE = 2;
private static final int SCIENTIFICSTYLE = 3;
private static final int INTEGERSTYLE = 4;
private final LocaleProviderAdapter.Type type;
- private final Set<String> langtags;
! public NumberFormatProviderImpl(LocaleProviderAdapter.Type type, Set<String> langtags) {
this.type = type;
- this.langtags = langtags;
}
/**
* Returns an array of all locales for which this locale service provider
* can provide localized objects or names.
--- 63,75 ----
private static final int PERCENTSTYLE = 2;
private static final int SCIENTIFICSTYLE = 3;
private static final int INTEGERSTYLE = 4;
private final LocaleProviderAdapter.Type type;
! public NumberFormatProviderImpl(LocaleProviderAdapter.Type type) {
this.type = type;
}
/**
* Returns an array of all locales for which this locale service provider
* can provide localized objects or names.
*** 84,94 ****
return LocaleProviderAdapter.forType(type).getAvailableLocales();
}
@Override
public boolean isSupportedLocale(Locale locale) {
! return LocaleProviderAdapter.isSupportedLocale(locale, type, langtags);
}
/**
* Returns a new <code>NumberFormat</code> instance which formats
* monetary values for the specified locale.
--- 82,92 ----
return LocaleProviderAdapter.forType(type).getAvailableLocales();
}
@Override
public boolean isSupportedLocale(Locale locale) {
! return LocaleProviderAdapter.isSupportedLocale(locale, type, DateFormatProviderImpl.getLangTags(type));
}
/**
* Returns a new <code>NumberFormat</code> instance which formats
* monetary values for the specified locale.
*** 220,227 ****
}
}
@Override
public Set<String> getAvailableLanguageTags() {
! return langtags;
}
}
--- 218,225 ----
}
}
@Override
public Set<String> getAvailableLanguageTags() {
! return DateFormatProviderImpl.getLangTags(type);
}
}