org.geotools.util
Class SimpleInternationalString

java.lang.Object
  extended byorg.geotools.util.AbstractInternationalString
      extended byorg.geotools.util.SimpleInternationalString
All Implemented Interfaces:
java.lang.CharSequence, java.lang.Comparable, org.opengis.util.InternationalString, java.io.Serializable

public class SimpleInternationalString
extends AbstractInternationalString
implements java.io.Serializable

A simple international string consisting of a single string for all locales. For such a particular case, this implementation is the more effective than other implementations provided in this package.

Since:
2.1
Version:
$Id: SimpleInternationalString.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
Serialized Form

Constructor Summary
SimpleInternationalString(java.lang.String message)
          Creates a new instance of international string.
 
Method Summary
 boolean equals(java.lang.Object object)
          Compares this international string with the specified object for equality.
 int hashCode()
          Returns a hash code value for this international text.
 java.lang.String toString(java.util.Locale locale)
          Returns the same string for all locales.
static AbstractInternationalString wrap(java.lang.CharSequence string)
          If the specified string is null or an instance of AbstractInternationalString, returns it unchanged.
 
Methods inherited from class org.geotools.util.AbstractInternationalString
charAt, compareTo, length, subSequence, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleInternationalString

public SimpleInternationalString(java.lang.String message)
Creates a new instance of international string.

Parameters:
message - The string for all locales.
Method Detail

wrap

public static AbstractInternationalString wrap(java.lang.CharSequence string)
If the specified string is null or an instance of AbstractInternationalString, returns it unchanged. Otherwise, wraps the string value in a .


toString

public java.lang.String toString(java.util.Locale locale)
Returns the same string for all locales. This is the string given to the constructor.

Specified by:
toString in interface org.opengis.util.InternationalString
Specified by:
toString in class AbstractInternationalString
Parameters:
locale - The desired locale for the string to be returned, or for a string in the implementation default locale.
Returns:
The string in the given locale if available, or in the default locale otherwise.

equals

public boolean equals(java.lang.Object object)
Compares this international string with the specified object for equality.


hashCode

public int hashCode()
Returns a hash code value for this international text.



Copyright © GeoTools. All Rights Reserved.