OBEROn SDK

com.oberon.util
Class NumberFormatter

java.lang.Object
  extended by com.oberon.util.NumberFormatter

public class NumberFormatter
extends java.lang.Object

Class NumberFormatter defines a method to format a Vector of integers as a character string according to a supplied format specification.

Version:
17 November 1999

Constructor Summary
NumberFormatter()
           
 
Method Summary
 java.lang.String format(int number, int groupSize, java.lang.String groupSeparator, java.lang.String letterValue, Numberer numberer)
          Format a single number.
 java.lang.String format(java.util.Vector<java.lang.Integer> numbers, int groupSize, java.lang.String groupSeparator, java.lang.String letterValue, Numberer numberer)
          Format a vector of numbers.
 Numberer getNumberer()
           
 void prepare(java.lang.String format)
          Tokenize the format pattern.
 void setNumberer(Numberer numberer)
          Allocate a numberer appropriate to the selected language
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberFormatter

public NumberFormatter()
Method Detail

setNumberer

public void setNumberer(Numberer numberer)
Allocate a numberer appropriate to the selected language


getNumberer

public Numberer getNumberer()

prepare

public void prepare(java.lang.String format)
Tokenize the format pattern.

Parameters:
format - the format specification. Contains one of the following values:
  • "1": conventional decimal numbering
  • "a": sequence a, b, c, ... aa, ab, ac, ...
  • "A": sequence A, B, C, ... AA, AB, AC, ...
  • "i": sequence i, ii, iii, iv, v ...
  • "I": sequence I, II, III, IV, V, ...
This symbol may be preceded and followed by punctuation (any other characters) which is copied to the output string.

format

public java.lang.String format(java.util.Vector<java.lang.Integer> numbers,
                               int groupSize,
                               java.lang.String groupSeparator,
                               java.lang.String letterValue,
                               Numberer numberer)
Format a vector of numbers.

Parameters:
numbers - the numbers to be formatted (a sequence of integer values)
Returns:
the formatted output string.

format

public java.lang.String format(int number,
                               int groupSize,
                               java.lang.String groupSeparator,
                               java.lang.String letterValue,
                               Numberer numberer)
Format a single number. The format/template has the same syntax as for a Vector of numbers.


OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.