org.jfree.chart.axis
Class CompassFormat

java.lang.Object
  extended byjava.text.Format
      extended byjava.text.NumberFormat
          extended byorg.jfree.chart.axis.CompassFormat
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class CompassFormat
extends java.text.NumberFormat

A formatter that displays numbers as directions.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.text.NumberFormat
java.text.NumberFormat.Field
 
Field Summary
static java.lang.String[] DIRECTIONS
          The directions.
 
Fields inherited from class java.text.NumberFormat
FRACTION_FIELD, INTEGER_FIELD
 
Constructor Summary
CompassFormat()
          Creates a new formatter.
 
Method Summary
 java.lang.StringBuffer format(double number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
           
 java.lang.StringBuffer format(long number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
           
 java.lang.String getDirectionCode(double direction)
          Returns a string representing the direction.
 java.lang.Number parse(java.lang.String source, java.text.ParsePosition parsePosition)
          This method returns null for all inputs.
 
Methods inherited from class java.text.NumberFormat
clone, equals, format, format, format, getAvailableLocales, getCurrency, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, hashCode, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setCurrency, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setParseIntegerOnly
 
Methods inherited from class java.text.Format
format, formatToCharacterIterator, parseObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTIONS

public static final java.lang.String[] DIRECTIONS
The directions.

Constructor Detail

CompassFormat

public CompassFormat()
Creates a new formatter.

Method Detail

getDirectionCode

public java.lang.String getDirectionCode(double direction)
Returns a string representing the direction.

Parameters:
direction - the direction.
Returns:
a string.

format

public java.lang.StringBuffer format(double number,
                                     java.lang.StringBuffer toAppendTo,
                                     java.text.FieldPosition pos)

format

public java.lang.StringBuffer format(long number,
                                     java.lang.StringBuffer toAppendTo,
                                     java.text.FieldPosition pos)

parse

public java.lang.Number parse(java.lang.String source,
                              java.text.ParsePosition parsePosition)
This method returns null for all inputs. This class cannot be used for parsing.

Parameters:
source - the source string.
parsePosition - the parse position.
Returns:
null.