Tea Java Runtime API
Version 3.1.0

com.pdmfc.tea.modules.string
Class SFormater

java.lang.Object
  |
  +--com.pdmfc.tea.modules.string.SFormater

public abstract class SFormater
extends java.lang.Object

Implements string formating with printf style formats.

This is an abstract class. Derived classes should implement the append() methods.


Constructor Summary
SFormater()
          Initializes the object internal state.
 
Method Summary
protected abstract  void append(char c)
          Appends a char to the formated result so far.
protected abstract  void append(java.lang.String s)
          Appends a string to the formated result so far.
 void format(java.lang.String fmtString, java.lang.Object[] args, int firstArg)
          Creates the formated string by sucessive calls to the append() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SFormater

public SFormater()
Initializes the object internal state.
Method Detail

append

protected abstract void append(java.lang.String s)
Appends a string to the formated result so far.

This is an abstract method and must be implemented in a derived class.

Parameters:
s - The string to be appended.

append

protected abstract void append(char c)
Appends a char to the formated result so far.

This is an abstract method and must be implemented in a derived class.

Parameters:
c - The char to be appended.

format

public final void format(java.lang.String fmtString,
                         java.lang.Object[] args,
                         int firstArg)
                  throws SNumArgException,
                         STypeException
Creates the formated string by sucessive calls to the append() method.
Parameters:
fmtString - The printf like format string.
args - Array with the objects to be formated.
Throws:
SNumArgException - Thrown if there were not enough arguments acording to the format string.
STypeException - Thrown if some of the arguments was of a type not expected by the format string.

Tea Java Runtime API
Version 3.1.0

© 2002 PDM&FC, All Rights Reserved.