All Implemented Interfaces:
Serializable, Cloneable, Localized

public class LocationFormat extends TabularFormat<AbstractLocation>
Formats Location instances in a tabular format. This format assumes a monospaced font and an encoding supporting drawing box characters (e.g. UTF-8).

Example

The location identified by "32TNL83" in the military grid reference system can be represented by the following string formatted using Locale​.ENGLISH:
   ┌─────────────────────────────────────────────────────────────┐
   │ Location type:               Grid zone designator           │
   │ Geographic identifier:       32TNL83                        │
   │ West bound:                    580,000 m    —     9°57′00″E │
   │ Representative value:          585,000 m    —    10°00′36″E │
   │ East bound:                    590,000 m    —    10°04′13″E │
   │ South bound:                 4,530,000 m    —    40°54′58″N │
   │ Representative value:        4,535,000 m    —    40°57′42″N │
   │ North bound:                 4,540,000 m    —    41°00′27″N │
   │ Coordinate reference system: WGS 84 / UTM zone 32N          │
   └─────────────────────────────────────────────────────────────┘

Limitations

  • The current implementation can only format features — parsing is not yet implemented.
  • Location­Format, like most java​.text​.Format subclasses, is not thread-safe.
Since:
0.8
See Also:
  • Constructor Details

    • LocationFormat

      public LocationFormat(Locale locale, TimeZone timezone)
      Creates a new format for the given locale. The given locale can be null or Locale​.ROOT if this format shall format "unlocalized" strings.
      Parameters:
      locale - the locale for the new Format, or null for Locale​.ROOT.
      timezone - the timezone, or null for UTC.
  • Method Details