mondrian.util
Class Format.CompoundFormat

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

static class Format.CompoundFormat
extends Format.BasicFormat

CompoundFormat is an implementation of Format.BasicFormat where each value is formatted by applying a sequence of format elements. Each format element is itself a format.

See Also:
Format.AlternateFormat
 

Field Summary
(package private)  Format.BasicFormat[] formats
           
 
Fields inherited from class mondrian.util.Format.BasicFormat
code
 
Constructor Summary
Format.CompoundFormat(Format.BasicFormat[] formats)
           
 
Method Summary
(package private)  void format(Calendar v, StringBuilder buf)
           
(package private)  void format(Date v, StringBuilder buf)
           
(package private)  void format(double v, StringBuilder buf)
           
(package private)  void format(long v, StringBuilder buf)
           
(package private)  void format(String v, StringBuilder buf)
           
(package private)  void formatNull(StringBuilder buf)
           
(package private)  boolean isApplicableTo(double n)
          Returns whether this format can handle a given value.
 
Methods inherited from class mondrian.util.Format.BasicFormat
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.CompoundFormat

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

formatNull

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

format

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

format

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

format

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

format

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

format

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

isApplicableTo

boolean isApplicableTo(double n)
Description copied from class: Format.BasicFormat
Returns whether this format can handle a given value.

Usually returns true; one notable exception is a format for negative numbers which causes the number to be underflow to zero and therefore be ineligible for the negative format.

Overrides:
isApplicableTo in class Format.BasicFormat
Parameters:
n - value
Returns:
Whether this format is applicable for a given value

SourceForge.net_Logo