gnu.text

Class LiteralFormat


public class LiteralFormat
extends ReportFormat

Get the index'th parameter for the conversion specification specs[speci]. Note that parameters are numbered from 1 to numParams(speci). The list of arguments to be converted is args, with the current index (as of the start of this conversion, i.e. not taking into account earlier PARAM_FROM_LIST paramaters for this conversion) in start. The default value (used if PARAM_UNSPECIFIED) is defaultValue.

Field Summary

Fields inherited from class gnu.text.ReportFormat

PARAM_FROM_COUNT, PARAM_FROM_LIST, PARAM_UNSPECIFIED

Constructor Summary

LiteralFormat(String text)
LiteralFormat(StringBuffer sbuf)
LiteralFormat(char[] text)

Method Summary

String
content()
Return the text that would be printed by the format.
int
format(Object[] args, int start, Writer dst, FieldPosition fpos)
Format an array of arguments, and write out the result.
Object
parseObject(String text, java.text.ParsePosition status)
String
toString()

Methods inherited from class gnu.text.ReportFormat

format, format, format, format, format, format, getParam, getParam, getParam, nextArg, parseObject, print, result, resultCode

Constructor Details

LiteralFormat

public LiteralFormat(String text)

LiteralFormat

public LiteralFormat(StringBuffer sbuf)

LiteralFormat

public LiteralFormat(char[] text)

Method Details

content

public String content()
Return the text that would be printed by the format.

format

public int format(Object[] args,
                  int start,
                  Writer dst,
                  FieldPosition fpos)
            throws java.io.IOException
Format an array of arguments, and write out the result.
Overrides:
format in interface ReportFormat
Parameters:
args - the objects to be formatted
start - the index (in args) of the argument to start with
dst - where to write the result
Returns:
an integer result(resultCode, nextArg), where nextArg is the index following the last argument processed, and code is a result code (normally 0, or negative if early termintation)

parseObject

public Object parseObject(String text,
                          java.text.ParsePosition status)
Overrides:
parseObject in interface ReportFormat

toString

public String toString()