org.jfree.chart.axis

Class CompassFormat


public class CompassFormat
extends NumberFormat

A formatter that displays numbers as directions.

Field Summary

static String[]
DIRECTIONS
The directions.

Constructor Summary

CompassFormat()
Creates a new formatter.

Method Summary

StringBuffer
format(double number, StringBuffer toAppendTo, FieldPosition pos)
StringBuffer
format(long number, StringBuffer toAppendTo, FieldPosition pos)
String
getDirectionCode(double direction)
Returns a string representing the direction.
Number
parse(String source, ParsePosition parsePosition)
This method returns null for all inputs.

Field Details

DIRECTIONS

public static final String[] DIRECTIONS
The directions.

Constructor Details

CompassFormat

public CompassFormat()
Creates a new formatter.

Method Details

format

public StringBuffer format(double number,
                           StringBuffer toAppendTo,
                           FieldPosition pos)

format

public StringBuffer format(long number,
                           StringBuffer toAppendTo,
                           FieldPosition pos)

getDirectionCode

public String getDirectionCode(double direction)
Returns a string representing the direction.
Parameters:
direction - the direction.
Returns:
A string.

parse

public Number parse(String source,
                    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.