pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.service.request
Class Locale

java.lang.Object
  extended by org.torweg.pulse.service.request.Locale
All Implemented Interfaces:
java.io.Serializable

public class Locale
extends java.lang.Object
implements java.io.Serializable

defines a locale for the pulse system.

Version:
$Revision: 1395 $
Author:
Thomas Weber
See Also:
Serialized Form

Constructor Summary
protected Locale()
          used by JAXB.
  Locale(java.lang.String l, java.lang.String c, java.lang.String v, boolean d)
          creates a new Locale.
 
Method Summary
 void addAlias(Locale alias)
          adds an alias for the locale.
 boolean equals(java.lang.Object o)
          checks if a given Object is equal to this Locale.
 java.util.Collection<Locale> getAliases()
           
 java.lang.String getCountry()
           
 java.lang.String getLanguage()
           
 java.lang.String getVariant()
           
 int hashCode()
          returns a hash code for the instance.
 boolean isDefault()
           
 boolean isDefaultLanguage()
          returns the preference value of the Locale.
 boolean isInactive()
          returns whether the Locale is inactive.
 void setCountry(java.lang.String c)
           
 void setDefault(boolean d)
          sets the default-flag of the locale.
 void setDefaultLanguage(boolean b)
          sets the default language flag.
 void setInactive(boolean b)
          marks or unmarks a Locale as inactive.
 void setLanguage(java.lang.String l)
           
 void setVariant(java.lang.String v)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Locale

protected Locale()
used by JAXB.


Locale

public Locale(java.lang.String l,
              java.lang.String c,
              java.lang.String v,
              boolean d)
creates a new Locale.

Parameters:
l - the language
c - the country, or null
v - the variant, or null
d - flag, indicating whether the locale is the default locale
Method Detail

getAliases

public final java.util.Collection<Locale> getAliases()
Returns:
Returns the aliases.

addAlias

public final void addAlias(Locale alias)
adds an alias for the locale.

Parameters:
alias - the alias to add.

getCountry

public final java.lang.String getCountry()
Returns:
returns the country.

setCountry

public final void setCountry(java.lang.String c)
Parameters:
c - the country to set.

getLanguage

public final java.lang.String getLanguage()
Returns:
returns the language.

setLanguage

public final void setLanguage(java.lang.String l)
Parameters:
l - The language to set.

getVariant

public final java.lang.String getVariant()
Returns:
returns the variant.

setVariant

public final void setVariant(java.lang.String v)
Parameters:
v - The variant to set.

isDefault

public final boolean isDefault()
Returns:
true, if the locale is the default locale.

setDefault

public final void setDefault(boolean d)
sets the default-flag of the locale.

Parameters:
d - true, if the locale shall be the default locale

hashCode

public final int hashCode()
returns a hash code for the instance.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for the instance

equals

public final boolean equals(java.lang.Object o)
checks if a given Object is equal to this Locale.

An Object is equal to this Locale, if it is an instance of Locale with the same values for country, language and variant.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to check
Returns:
true, if the given object is an instance of Locale with the same values for country, language and variant.

setInactive

public final void setInactive(boolean b)
marks or unmarks a Locale as inactive.

Parameters:
b - the flag to set

isInactive

public final boolean isInactive()
returns whether the Locale is inactive.

Returns:
whether the Locale is inactive

isDefaultLanguage

public final boolean isDefaultLanguage()
returns the preference value of the Locale.

Returns:
true, if the locale is marked to be a default language

setDefaultLanguage

public final void setDefaultLanguage(boolean b)
sets the default language flag.

Parameters:
b - the default language flag to set

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a string representation