Class RegularGroupFormatter

  extended by net.sf.saxon.expr.number.NumericGroupFormatter
      extended by net.sf.saxon.expr.number.RegularGroupFormatter
All Implemented Interfaces:

public class RegularGroupFormatter
extends NumericGroupFormatter

A RegularGroupFormatter is a NumericGroupFormatter that inserts a separator at constant intervals through a number: for example, a comma after every three digits counting from the right.

See Also:
Serialized Form

Constructor Summary
RegularGroupFormatter(int grpSize, String grpSep)
          Create a RegularGroupFormatter
Method Summary
 String format(FastStringBuffer value)
          Reformat a number to add grouping separators
 String getSeparator()
          Get the grouping separator to be used.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public RegularGroupFormatter(int grpSize,
                             String grpSep)
Create a RegularGroupFormatter

grpSize - the grouping size. If zero, no grouping separators are inserted
grpSep - the grouping separator (normally a single character, but may be a surrogate pair)
Method Detail


public String format(FastStringBuffer value)
Description copied from class: NumericGroupFormatter
Reformat a number to add grouping separators

Specified by:
format in class NumericGroupFormatter
value - a buffer holding the number to be reformatted
the reformatted number


public String getSeparator()
Get the grouping separator to be used. If more than one is used, return the last. If no grouping separators are used, return null

Specified by:
getSeparator in class NumericGroupFormatter
the grouping separator

Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.