name = ((DefaultNameProvider) np).getName(locale, iID, nameKey, isStandardOffset(instant)); } else { name = np.getName(locale, iID, nameKey);
name = ((DefaultNameProvider) np).getShortName(locale, iID, nameKey, isStandardOffset(instant)); } else { name = np.getShortName(locale, iID, nameKey);
@Test public void testGetNameProviderName() { assertEquals(null, DateTimeZone.getNameProvider().getName(null, "Europe/London", "BST")); assertEquals(null, DateTimeZone.getNameProvider().getName(Locale.ENGLISH, null, "BST")); assertEquals(null, DateTimeZone.getNameProvider().getName(Locale.ENGLISH, "Europe/London", null)); assertEquals(null, DateTimeZone.getNameProvider().getName(null, null, null)); }
name = ((DefaultNameProvider) np).getShortName(locale, iID, nameKey, isStandardOffset(instant)); } else { name = np.getShortName(locale, iID, nameKey);
name = ((DefaultNameProvider) np).getName(locale, iID, nameKey, isStandardOffset(instant)); } else { name = np.getName(locale, iID, nameKey);
@Test public void testGetShortNameProviderName() { assertEquals(null, DateTimeZone.getNameProvider().getShortName(null, "Europe/London", "BST")); assertEquals(null, DateTimeZone.getNameProvider().getShortName(Locale.ENGLISH, null, "BST")); assertEquals(null, DateTimeZone.getNameProvider().getShortName(Locale.ENGLISH, "Europe/London", null)); assertEquals(null, DateTimeZone.getNameProvider().getShortName(null, null, null)); }
/** * Gets the long name of this datetime zone suitable for display using * the specified locale. * <p> * If the name is not available for the locale, then this method returns a * string in the format <code>[+-]hh:mm</code>. * * @param instant milliseconds from 1970-01-01T00:00:00Z to get the name for * @param locale the locale to get the name for * @return the human-readable long name in the specified locale */ public String getName(long instant, Locale locale) { if (locale == null) { locale = Locale.getDefault(); } String nameKey = getNameKey(instant); if (nameKey == null) { return iID; } String name = cNameProvider.getName(locale, iID, nameKey); if (name != null) { return name; } return printOffset(getOffset(instant)); }
/** * Gets the short name of this datetime zone suitable for display using * the specified locale. * <p> * If the name is not available for the locale, then this method returns a * string in the format <code>[+-]hh:mm</code>. * * @param instant milliseconds from 1970-01-01T00:00:00Z to get the name for * @param locale the locale to get the name for * @return the human-readable short name in the specified locale */ public String getShortName(long instant, Locale locale) { if (locale == null) { locale = Locale.getDefault(); } String nameKey = getNameKey(instant); if (nameKey == null) { return iID; } String name = cNameProvider.getShortName(locale, iID, nameKey); if (name != null) { return name; } return printOffset(getOffset(instant)); }
/** * Gets the long name of this datetime zone suitable for display using * the specified locale. * <p> * If the name is not available for the locale, then this method returns a * string in the format <code>[+-]hh:mm</code>. * * @param instant milliseconds from 1970-01-01T00:00:00Z to get the name for * @param locale the locale to get the name for * @return the human-readable long name in the specified locale */ public String getName(long instant, Locale locale) { if (locale == null) { locale = Locale.getDefault(); } String nameKey = getNameKey(instant); if (nameKey == null) { return iID; } String name = cNameProvider.getName(locale, iID, nameKey); if (name != null) { return name; } return printOffset(getOffset(instant)); }
/** * Gets the short name of this datetime zone suitable for display using * the specified locale. * <p> * If the name is not available for the locale, then this method returns a * string in the format <code>[+-]hh:mm</code>. * * @param instant milliseconds from 1970-01-01T00:00:00Z to get the name for * @param locale the locale to get the name for * @return the human-readable short name in the specified locale */ public String getShortName(long instant, Locale locale) { if (locale == null) { locale = Locale.getDefault(); } String nameKey = getNameKey(instant); if (nameKey == null) { return iID; } String name = cNameProvider.getShortName(locale, iID, nameKey); if (name != null) { return name; } return printOffset(getOffset(instant)); }
/** * Gets the long name of this datetime zone suitable for display using * the specified locale. * <p> * If the name is not available for the locale, then this method returns a * string in the format <code>[+-]hh:mm</code>. * * @param instant milliseconds from 1970-01-01T00:00:00Z to get the name for * @param locale the locale to get the name for * @return the human-readable long name in the specified locale */ public String getName(long instant, Locale locale) { if (locale == null) { locale = Locale.getDefault(); } String nameKey = getNameKey(instant); if (nameKey == null) { return iID; } String name = cNameProvider.getName(locale, iID, nameKey); if (name != null) { return name; } return printOffset(getOffset(instant)); }
/** * Gets the short name of this datetime zone suitable for display using * the specified locale. * <p> * If the name is not available for the locale, then this method returns a * string in the format <code>[+-]hh:mm</code>. * * @param instant milliseconds from 1970-01-01T00:00:00Z to get the name for * @param locale the locale to get the name for * @return the human-readable short name in the specified locale */ public String getShortName(long instant, Locale locale) { if (locale == null) { locale = Locale.getDefault(); } String nameKey = getNameKey(instant); if (nameKey == null) { return iID; } String name = cNameProvider.getShortName(locale, iID, nameKey); if (name != null) { return name; } return printOffset(getOffset(instant)); }
/** * Gets the long name of this datetime zone suitable for display using * the specified locale. * <p> * If the name is not available for the locale, then this method returns a * string in the format <code>[+-]hh:mm</code>. * * @param instant milliseconds from 1970-01-01T00:00:00Z to get the name for * @param locale the locale to get the name for * @return the human-readable long name in the specified locale */ public String getName(long instant, Locale locale) { if (locale == null) { locale = Locale.getDefault(); } String nameKey = getNameKey(instant); if (nameKey == null) { return iID; } String name = cNameProvider.getName(locale, iID, nameKey); if (name != null) { return name; } return printOffset(getOffset(instant)); }
/** * Gets the short name of this datetime zone suitable for display using * the specified locale. * <p> * If the name is not available for the locale, then this method returns a * string in the format <code>[+-]hh:mm</code>. * * @param instant milliseconds from 1970-01-01T00:00:00Z to get the name for * @param locale the locale to get the name for * @return the human-readable short name in the specified locale */ public String getShortName(long instant, Locale locale) { if (locale == null) { locale = Locale.getDefault(); } String nameKey = getNameKey(instant); if (nameKey == null) { return iID; } String name = cNameProvider.getShortName(locale, iID, nameKey); if (name != null) { return name; } return printOffset(getOffset(instant)); }
/** * Gets the long name of this datetime zone suitable for display using * the specified locale. * <p> * If the name is not available for the locale, then this method returns a * string in the format <code>[+-]hh:mm</code>. * * @param instant milliseconds from 1970-01-01T00:00:00Z to get the name for * @param locale the locale to get the name for * @return the human-readable long name in the specified locale */ public String getName(long instant, Locale locale) { if (locale == null) { locale = Locale.getDefault(); } String nameKey = getNameKey(instant); if (nameKey == null) { return iID; } String name = cNameProvider.getName(locale, iID, nameKey); if (name != null) { return name; } return printOffset(getOffset(instant)); }
/** * Gets the short name of this datetime zone suitable for display using * the specified locale. * <p> * If the name is not available for the locale, then this method returns a * string in the format <code>[+-]hh:mm</code>. * * @param instant milliseconds from 1970-01-01T00:00:00Z to get the name for * @param locale the locale to get the name for * @return the human-readable short name in the specified locale */ public String getShortName(long instant, Locale locale) { if (locale == null) { locale = Locale.getDefault(); } String nameKey = getNameKey(instant); if (nameKey == null) { return iID; } String name = cNameProvider.getShortName(locale, iID, nameKey); if (name != null) { return name; } return printOffset(getOffset(instant)); }
/** * Gets the long name of this datetime zone suitable for display using * the specified locale. * <p> * If the name is not available for the locale, then this method returns a * string in the format <code>[+-]hh:mm</code>. * * @param instant milliseconds from 1970-01-01T00:00:00Z to get the name for * @param locale the locale to get the name for * @return the human-readable long name in the specified locale */ public String getName(long instant, Locale locale) { if (locale == null) { locale = Locale.getDefault(); } String nameKey = getNameKey(instant); if (nameKey == null) { return iID; } String name = cNameProvider.getName(locale, iID, nameKey); if (name != null) { return name; } return printOffset(getOffset(instant)); }
/** * Gets the short name of this datetime zone suitable for display using * the specified locale. * <p> * If the name is not available for the locale, then this method returns a * string in the format <code>[+-]hh:mm</code>. * * @param instant milliseconds from 1970-01-01T00:00:00Z to get the name for * @param locale the locale to get the name for * @return the human-readable short name in the specified locale */ public String getShortName(long instant, Locale locale) { if (locale == null) { locale = Locale.getDefault(); } String nameKey = getNameKey(instant); if (nameKey == null) { return iID; } String name = cNameProvider.getShortName(locale, iID, nameKey); if (name != null) { return name; } return printOffset(getOffset(instant)); }
/** * Gets the long name of this datetime zone suitable for display using * the specified locale. * <p> * If the name is not available for the locale, then this method returns a * string in the format <code>[+-]hh:mm</code>. * * @param instant milliseconds from 1970-01-01T00:00:00Z to get the name for * @param locale the locale to get the name for * @return the human-readable long name in the specified locale */ public String getName(long instant, Locale locale) { if (locale == null) { locale = Locale.getDefault(); } String nameKey = getNameKey(instant); if (nameKey == null) { return iID; } String name = cNameProvider.getName(locale, iID, nameKey); if (name != null) { return name; } return printOffset(getOffset(instant)); }
/** * Gets the short name of this datetime zone suitable for display using * the specified locale. * <p> * If the name is not available for the locale, then this method returns a * string in the format <code>[+-]hh:mm</code>. * * @param instant milliseconds from 1970-01-01T00:00:00Z to get the name for * @param locale the locale to get the name for * @return the human-readable short name in the specified locale */ public String getShortName(long instant, Locale locale) { if (locale == null) { locale = Locale.getDefault(); } String nameKey = getNameKey(instant); if (nameKey == null) { return iID; } String name = cNameProvider.getShortName(locale, iID, nameKey); if (name != null) { return name; } return printOffset(getOffset(instant)); }