mondrian.util
Class Format.AlternateFormat

java.lang.Object
  extended by mondrian.util.Format.BasicFormat
      extended by mondrian.util.Format.AlternateFormat
Enclosing class:
Format

static class Format.AlternateFormat
extends Format.BasicFormat

AlternateFormat is an implementation of Format.BasicFormat which allows a different format to be used for different kinds of values. If there are 4 formats, purposes are as follows:

  1. positive numbers
  2. negative numbers
  3. zero
  4. null values
If there are fewer than 4 formats, the first is used as a fall-back. See the the visual basic format specification for more details.

 

Field Summary
(package private)  Format.BasicFormat[] formats
           
 
Fields inherited from class mondrian.util.Format.BasicFormat
code
 
Constructor Summary
Format.AlternateFormat(Format.BasicFormat[] formats)
           
 
Method Summary
(package private)  void format(Calendar calendar, StringBuilder buf)
           
(package private)  void format(Date date, StringBuilder buf)
           
(package private)  void format(double n, StringBuilder buf)
           
(package private)  void format(long n, StringBuilder buf)
           
(package private)  void format(String s, StringBuilder buf)
           
(package private)  void formatNull(StringBuilder buf)
           
 
Methods inherited from class mondrian.util.Format.BasicFormat
isApplicableTo, isApplicableTo, isDate, isNumeric, isString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

formats

final Format.BasicFormat[] formats
Constructor Detail

Format.AlternateFormat

Format.AlternateFormat(Format.BasicFormat[] formats)
Method Detail

formatNull

void formatNull(StringBuilder buf)
Overrides:
formatNull in class Format.BasicFormat

format

void format(double n,
            StringBuilder buf)
Overrides:
format in class Format.BasicFormat

format

void format(long n,
            StringBuilder buf)
Overrides:
format in class Format.BasicFormat

format

void format(String s,
            StringBuilder buf)
Overrides:
format in class Format.BasicFormat

format

void format(Date date,
            StringBuilder buf)
Overrides:
format in class Format.BasicFormat

format

void format(Calendar calendar,
            StringBuilder buf)
Overrides:
format in class Format.BasicFormat

SourceForge.net_Logo