org.deegree.geometry.io
Class DecimalCoordinateFormatter

java.lang.Object
  extended by org.deegree.geometry.io.DecimalCoordinateFormatter
All Implemented Interfaces:
CoordinateFormatter

public class DecimalCoordinateFormatter
extends Object
implements CoordinateFormatter

CoordinateFormatter based on DecimalFormat.

Version:
$Revision: 31641 $, $Date: 2011-08-24 21:24:55 +0200 (Wed, 24 Aug 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Field Summary
static int DEFAULT_PLACES
          Number of decimal places used by default (6).
 
Constructor Summary
DecimalCoordinateFormatter()
          Creates a new DecimalCoordinateFormatter instance that uses DEFAULT_PLACES.
DecimalCoordinateFormatter(DecimalFormat decimalFormat)
          Creates a new DecimalCoordinateFormatter instance from the given DecimalFormat.
DecimalCoordinateFormatter(int decimalPlaces)
          Creates a new DecimalCoordinateFormatter instance that uses the specified number of decimal places.
DecimalCoordinateFormatter(IUnit uom)
          Creates a new DecimalCoordinateFormatter instance suitable for the specified Unit.
 
Method Summary
 String format(double number)
          Returns the formatted string representation of the given ordinate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PLACES

public static final int DEFAULT_PLACES
Number of decimal places used by default (6).

See Also:
Constant Field Values
Constructor Detail

DecimalCoordinateFormatter

public DecimalCoordinateFormatter()
Creates a new DecimalCoordinateFormatter instance that uses DEFAULT_PLACES.


DecimalCoordinateFormatter

public DecimalCoordinateFormatter(IUnit uom)
Creates a new DecimalCoordinateFormatter instance suitable for the specified Unit.

Parameters:
uom - unit-of-measure, may be null

DecimalCoordinateFormatter

public DecimalCoordinateFormatter(int decimalPlaces)
Creates a new DecimalCoordinateFormatter instance that uses the specified number of decimal places.

Parameters:
decimalPlaces - number of decimal places

DecimalCoordinateFormatter

public DecimalCoordinateFormatter(DecimalFormat decimalFormat)
Creates a new DecimalCoordinateFormatter instance from the given DecimalFormat.

Parameters:
decimalFormat - decimalFormat to use for formatting, must not be null
Method Detail

format

public String format(double number)
Description copied from interface: CoordinateFormatter
Returns the formatted string representation of the given ordinate.

Specified by:
format in interface CoordinateFormatter
Parameters:
number - ordinate to be formatted
Returns:
the formatted string, never null


Copyright © 2011. All Rights Reserved.