org.melati.poem
Class PoemLocale

java.lang.Object
  extended by org.melati.poem.PoemLocale

public class PoemLocale
extends java.lang.Object

A wrapper for a Locale for use within Melati.


Field Summary
static PoemLocale HERE
          Default Locale: GB.
 
Constructor Summary
PoemLocale(java.util.Locale locale)
          Constructor given a non-null Locale.
 
Method Summary
 java.text.DateFormat dateFormat(int style)
           
 boolean equals(java.lang.Object o)
          
static PoemLocale fromLanguageTag(java.lang.String tag)
          Creates a melati locale from a language tag as defined in RFC3066.
 int hashCode()
          Delegated to Locale.
 java.util.Locale locale()
           
 java.lang.String monthName(int monthNum)
           
 java.lang.String shortMonthName(int monthNum)
           
 java.text.DateFormat timestampFormat(int style)
           
 java.lang.String toString()
          Delegated to Locale.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

HERE

public static final PoemLocale HERE
Default Locale: GB.

Constructor Detail

PoemLocale

public PoemLocale(java.util.Locale locale)
Constructor given a non-null Locale.

Parameters:
locale - The Locale to base ours on.
Method Detail

fromLanguageTag

public static PoemLocale fromLanguageTag(java.lang.String tag)
Creates a melati locale from a language tag as defined in RFC3066.

Parameters:
tag - A language tag, for example, "en-gb"
Returns:
A melati locale from the tag if we can parse it, otherwise null

locale

public final java.util.Locale locale()
Returns:
the Locale

monthName

public java.lang.String monthName(int monthNum)
Parameters:
monthNum - numeric month
Returns:
full name of month

shortMonthName

public java.lang.String shortMonthName(int monthNum)
Parameters:
monthNum - numeric month
Returns:
short name of month

dateFormat

public java.text.DateFormat dateFormat(int style)
Parameters:
style - as defined in DateFormat
Returns:
a format of that style

timestampFormat

public java.text.DateFormat timestampFormat(int style)
Parameters:
style - as defined in DateFormat
Returns:
a format of that style

hashCode

public int hashCode()
Delegated to Locale.

Overrides:
hashCode in class java.lang.Object
See Also:
{@inheritDoc}, Object.hashCode()

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

toString

public java.lang.String toString()
Delegated to Locale.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2000-2009 PanEris. All Rights Reserved.