javax.time.calendar.format
Class DateTimeFormatSymbols

java.lang.Object
  extended by javax.time.calendar.format.DateTimeFormatSymbols

public final class DateTimeFormatSymbols
extends java.lang.Object

Localized symbols used in date and time formatting.

A significant part of dealing with dates and times is the localization. This class acts as a central point for accessing the information.

This class is immutable and thread-safe.

Author:
Stephen Colebourne

Field Summary
static DateTimeFormatSymbols STANDARD
          The standard set of non-localized symbols.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Checks if these symbols equal another set of symbols.
static java.util.Locale[] getAvailableLocales()
          Lists all the locales that are supported.
 char getDecimalSeparator()
          Gets the character that represents the decimal point.
 char getNegativeSign()
          Gets the character that represents the negative sign.
 char getPositiveSign()
          Gets the character that represents the positive sign.
 char getZeroDigit()
          Gets the character that represents zero.
 int hashCode()
          A hash code for these symbols.
static DateTimeFormatSymbols of(java.util.Locale locale)
          Obtains symbols for the specified locale.
static DateTimeFormatSymbols ofDefaultLocale()
          Obtains symbols for the default locale.
 java.lang.String toString()
          Returns a string describing these symbols.
 DateTimeFormatSymbols withDecimalSeparator(char decimalSeparator)
          Returns a copy of the info with a new character that represents the decimal point.
 DateTimeFormatSymbols withNegativeSign(char negativeSign)
          Returns a copy of the info with a new character that represents the negative sign.
 DateTimeFormatSymbols withPositiveSign(char positiveSign)
          Returns a copy of the info with a new character that represents the positive sign.
 DateTimeFormatSymbols withZeroDigit(char zeroDigit)
          Returns a copy of the info with a new character that represents zero.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

STANDARD

public static final DateTimeFormatSymbols STANDARD
The standard set of non-localized symbols.

This uses standard ASCII characters for zero, positive, negative and a dot for the decimal point.

Method Detail

getAvailableLocales

public static java.util.Locale[] getAvailableLocales()
Lists all the locales that are supported.

The locale 'en_US' will always be present.

Returns:
an array of locales for which localization is supported

ofDefaultLocale

public static DateTimeFormatSymbols ofDefaultLocale()
Obtains symbols for the default locale.

This method provides access to locale sensitive symbols.

Returns:
the info, not null

of

public static DateTimeFormatSymbols of(java.util.Locale locale)
Obtains symbols for the specified locale.

This method provides access to locale sensitive symbols.

Parameters:
locale - the locale, not null
Returns:
the info, not null

getZeroDigit

public char getZeroDigit()
Gets the character that represents zero.

The character used to represent digits may vary by culture. This method specifies the zero character to use, which implies the characters for one to nine.

Returns:
the character for zero

withZeroDigit

public DateTimeFormatSymbols withZeroDigit(char zeroDigit)
Returns a copy of the info with a new character that represents zero.

The character used to represent digits may vary by culture. This method specifies the zero character to use, which implies the characters for one to nine.

Parameters:
zeroDigit - the character for zero

getPositiveSign

public char getPositiveSign()
Gets the character that represents the positive sign.

The character used to represent a positive number may vary by culture. This method specifies the character to use.

Returns:
the character for the positive sign

withPositiveSign

public DateTimeFormatSymbols withPositiveSign(char positiveSign)
Returns a copy of the info with a new character that represents the positive sign.

The character used to represent a positive number may vary by culture. This method specifies the character to use.

Parameters:
positiveSign - the character for the positive sign

getNegativeSign

public char getNegativeSign()
Gets the character that represents the negative sign.

The character used to represent a negative number may vary by culture. This method specifies the character to use.

Returns:
the character for the negative sign

withNegativeSign

public DateTimeFormatSymbols withNegativeSign(char negativeSign)
Returns a copy of the info with a new character that represents the negative sign.

The character used to represent a negative number may vary by culture. This method specifies the character to use.

Parameters:
negativeSign - the character for the negative sign

getDecimalSeparator

public char getDecimalSeparator()
Gets the character that represents the decimal point.

The character used to represent a decimal point may vary by culture. This method specifies the character to use.

Returns:
the character for the decimal point

withDecimalSeparator

public DateTimeFormatSymbols withDecimalSeparator(char decimalSeparator)
Returns a copy of the info with a new character that represents the decimal point.

The character used to represent a decimal point may vary by culture. This method specifies the character to use.

Parameters:
decimalSeparator - the character for the decimal point

equals

public boolean equals(java.lang.Object obj)
Checks if these symbols equal another set of symbols.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to check, null returns false
Returns:
true if this is equal to the other date

hashCode

public int hashCode()
A hash code for these symbols.

Overrides:
hashCode in class java.lang.Object
Returns:
a suitable hash code

toString

public java.lang.String toString()
Returns a string describing these symbols.

Overrides:
toString in class java.lang.Object
Returns:
a string description, not null