Package org.apache.sis.util
Class SimpleInternationalString
Object
AbstractInternationalString
SimpleInternationalString
- All Implemented Interfaces:
- Serializable,- CharSequence,- Comparable<InternationalString>,- Formattable,- InternationalString
An international string consisting of a single string for all locales.
 For such a particular case, this implementation is more effective than
 other implementations provided in this package.
 
Instantiation
If the characters sequence to wrap is known to be aString instance, then
 the SimpleInternationalString(String) constructor is okay. Otherwise use
 the Types.toInternationalString(CharSequence) method.
 Immutability and thread safety
This class is immutable and thus inherently thread-safe. Subclasses may or may not be immutable, at implementation choice. But implementers are encouraged to make sure that subclasses remain immutable for more predictable behavior.- Since:
- 1.1
- See Also:
Defined in the sis-utility module
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new instance from the given string.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanCompares this international string with the specified object for equality.intReturns a hash code value for this international text.Returns the string representation, which is unique for all locales.Returns the same string for all locales.Methods inherited from class AbstractInternationalStringcharAt, compareTo, formatTo, length, subSequenceMethods inherited from class Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface CharSequencechars, codePoints, isEmpty
- 
Constructor Details- 
SimpleInternationalStringCreates a new instance from the given string. If the type of the text to wrap is the more genericCharSequenceinterface, then use theTypes.toInternationalString(CharSequence)method instead.- Parameters:
- text- the string for all locales.
 
 
- 
- 
Method Details- 
toStringReturns the string representation, which is unique for all locales.- Specified by:
- toStringin interface- CharSequence
- Specified by:
- toStringin interface- InternationalString
- Overrides:
- toStringin class- AbstractInternationalString
- Returns:
- the string in the default locale.
 
- 
toStringReturns the same string for all locales. This is the string given to the constructor.- Specified by:
- toStringin interface- InternationalString
- Specified by:
- toStringin class- AbstractInternationalString
- Parameters:
- locale- ignored in the- SimpleInternationalStringimplementation.
- Returns:
- the international string as a String.
- See Also:
 
- 
equalsCompares this international string with the specified object for equality.
- 
hashCodepublic int hashCode()Returns a hash code value for this international text.
 
-