org.joda.time.contrib.i18n
Class Territory

java.lang.Object
  extended by org.joda.time.contrib.i18n.Territory
Direct Known Subclasses:
CLDRTerritory

public abstract class Territory
extends Object

Provides time data for a specific territory, typically a country.

Many pieces of data used in dates and times varies by territory. This class provides access to that data.


Constructor Summary
protected Territory()
          Constructor.
 
Method Summary
 boolean equals(Object other)
          Is this territory equal (by id and class) to another.
static Territory forID(String id)
          Gets a territory instance for the specified id.
abstract  int getBusinessWeekEnd()
          Gets the day of week that the business week ends.
abstract  int getBusinessWeekStart()
          Gets the day of week that the business week starts.
abstract  int getFirstDayOfWeek()
          Gets the first day of the week.
abstract  String getID()
          Gets the territory id.
abstract  int getWeekendEnd()
          Gets the day of week that the weekend ends.
abstract  int getWeekendStart()
          Gets the day of week that the weekend starts.
 DateTimeZone getZone()
          Gets the time zone for the territory, selecting the zone of the most important city (the capital) if there are multiple zones.
abstract  DateTimeZone[] getZones()
          Gets the time zones applicable for the territory.
 int hashCode()
          Gets a suitable hashcode for this territory.
 String toString()
          Outputs a string vesion of the territory.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Territory

protected Territory()
Constructor.

Parameters:
id - the territory id, not null
Method Detail

forID

public static Territory forID(String id)
Gets a territory instance for the specified id.

The territory id must be one of those returned by getAvailableIDs.

Parameters:
id - the ID of the territory, not null
Returns:
the territory object for the ID
Throws:
IllegalArgumentException - if the ID is not recognised

getID

public abstract String getID()
Gets the territory id.

Returns:
the territory id, never null

getZones

public abstract DateTimeZone[] getZones()
Gets the time zones applicable for the territory.

Returns:
the array of zones, never null

getZone

public DateTimeZone getZone()
Gets the time zone for the territory, selecting the zone of the most important city (the capital) if there are multiple zones.

Returns:
the zone that best represents the territory, null if unknown

getFirstDayOfWeek

public abstract int getFirstDayOfWeek()
Gets the first day of the week. The value is expressed using ISO values (1=Mon,7=Sun).

Returns:
the first day of the week

getBusinessWeekStart

public abstract int getBusinessWeekStart()
Gets the day of week that the business week starts. The value is expressed using ISO values (1=Mon,7=Sun).

Returns:
the day of week that the business week starts

getBusinessWeekEnd

public abstract int getBusinessWeekEnd()
Gets the day of week that the business week ends. The value is expressed using ISO values (1=Mon,7=Sun).

Returns:
the day of week that the business week ends

getWeekendStart

public abstract int getWeekendStart()
Gets the day of week that the weekend starts. The value is expressed using ISO values (1=Mon,7=Sun).

Returns:
the day of week that the weekend starts

getWeekendEnd

public abstract int getWeekendEnd()
Gets the day of week that the weekend ends. The value is expressed using ISO values (1=Mon,7=Sun).

Returns:
the day of week that the weekend ends

equals

public boolean equals(Object other)
Is this territory equal (by id and class) to another.

Overrides:
equals in class Object
Parameters:
other - the other object to compare to
Returns:
trur if equal

hashCode

public int hashCode()
Gets a suitable hashcode for this territory.

Overrides:
hashCode in class Object
Returns:
a hashcode

toString

public String toString()
Outputs a string vesion of the territory.

Overrides:
toString in class Object
Returns:
string


Copyright © 2005-2011 Joda.org. All Rights Reserved.