JFreeChart 1.0.14-redhat-2

org.jfree.chart.axis
Class CompassFormat

java.lang.Object
  extended by java.text.Format
      extended by java.text.NumberFormat
          extended by org.jfree.chart.axis.CompassFormat
All Implemented Interfaces:
Serializable, Cloneable

public class CompassFormat
extends NumberFormat

A formatter that displays numbers as directions.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.NumberFormat
NumberFormat.Field
 
Field Summary
static String[] DIRECTIONS
          The directions.
 
Fields inherited from class java.text.NumberFormat
FRACTION_FIELD, INTEGER_FIELD
 
Constructor Summary
CompassFormat()
          Creates a new formatter.
 
Method Summary
 StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos)
          Formats a number into the specified string buffer.
 StringBuffer format(long number, StringBuffer toAppendTo, FieldPosition pos)
          Formats a number into the specified string buffer.
 String getDirectionCode(double direction)
          Returns a string representing the direction.
 Number parse(String source, 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, getRoundingMode, hashCode, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setCurrency, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setParseIntegerOnly, setRoundingMode
 
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 String[] DIRECTIONS
The directions.

Constructor Detail

CompassFormat

public CompassFormat()
Creates a new formatter.

Method Detail

getDirectionCode

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

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

format

public StringBuffer format(double number,
                           StringBuffer toAppendTo,
                           FieldPosition pos)
Formats a number into the specified string buffer.

Specified by:
format in class NumberFormat
Parameters:
number - the number to format.
toAppendTo - the string buffer.
pos - the field position (ignored here).
Returns:
The string buffer.

format

public StringBuffer format(long number,
                           StringBuffer toAppendTo,
                           FieldPosition pos)
Formats a number into the specified string buffer.

Specified by:
format in class NumberFormat
Parameters:
number - the number to format.
toAppendTo - the string buffer.
pos - the field position (ignored here).
Returns:
The string buffer.

parse

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

Specified by:
parse in class NumberFormat
Parameters:
source - the source string.
parsePosition - the parse position.
Returns:
null.

JFreeChart 1.0.14-redhat-2

Copyright © 2001-2012 JFree.org. All Rights Reserved.