org.melati.poem
Class PoemLocale

Package class diagram package PoemLocale
java.lang.Object
  extended by org.melati.poem.PoemLocale

public class PoemLocale
extends Object

A wrapper for a Locale for use within Melati.


Field Summary
static PoemLocale HERE
          Default Locale: GB.
 
Constructor Summary
PoemLocale(Locale locale)
          Constructor given a non-null Locale.
 
Method Summary
 DateFormat dateFormat(int style)
           
 boolean equals(Object o)
          
static PoemLocale from(Locale locale)
           
static PoemLocale fromLanguageTag(String tag)
          Creates a melati locale from a language tag as defined in RFC3066.
 int hashCode()
          Delegated to Locale.
 Locale locale()
           
 String monthName(int monthNum)
           
 String shortMonthName(int monthNum)
           
 DateFormat timestampFormat(int style)
           
 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(Locale locale)
Constructor given a non-null Locale.

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

fromLanguageTag

public static PoemLocale fromLanguageTag(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

from

public static PoemLocale from(Locale locale)

locale

public final Locale locale()
Returns:
the Locale

monthName

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

shortMonthName

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

dateFormat

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

timestampFormat

public 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 Object
See Also:
{@inheritDoc}, Object.hashCode()

equals

public boolean equals(Object o)

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

toString

public String toString()
Delegated to Locale.

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


Copyright © 2000-2010 PanEris. All Rights Reserved.