gnu.text

Class ReportFormat

Known Direct Subclasses:
CaseConvertFormat, CompoundFormat, FlushFormat, IntegerFormat, LiteralFormat, ObjectFormat, PadFormat

public abstract class ReportFormat
extends Format

Field Summary

static int
PARAM_FROM_COUNT
Some Formats use this to indicate a parameter that is the number of remaining paramaters.
static int
PARAM_FROM_LIST
Some Formats use this to indicate a parameter that is the extracted from the argment list.
static int
PARAM_UNSPECIFIED
Some Formats use this to indicate an unspecified parameter.

Method Summary

static int
format(Format fmt, Object[] args, int start, StringBuffer sbuf, FieldPosition fpos)
static int
format(Format fmt, Object[] args, int start, Writer dst, FieldPosition fpos)
StringBuffer
format(Object obj, StringBuffer sbuf, FieldPosition fpos)
int
format(Object arg, int start, Writer dst, FieldPosition fpos)
int
format(Object[] args, int start, StringBuffer sbuf, FieldPosition fpos)
abstract int
format(Object[] args, int start, Writer dst, FieldPosition fpos)
Format an array of arguments, and write out the result.
static int
getParam(Object arg, int defaultValue)
protected static char
getParam(int param, char defaultValue, Object[] args, int start)
protected static int
getParam(int param, int defaultValue, Object[] args, int start)
static int
nextArg(int result)
Object
parseObject(String text, java.text.ParsePosition status)
static void
print(Writer dst, String str)
static int
result(int resultCode, int nextArg)
static int
resultCode(int result)

Field Details

PARAM_FROM_COUNT

public static final int PARAM_FROM_COUNT
Some Formats use this to indicate a parameter that is the number of remaining paramaters.
Field Value:
-1342177280

PARAM_FROM_LIST

public static final int PARAM_FROM_LIST
Some Formats use this to indicate a parameter that is the extracted from the argment list.
Field Value:
-1610612736

PARAM_UNSPECIFIED

public static final int PARAM_UNSPECIFIED
Some Formats use this to indicate an unspecified parameter.
Field Value:
-1073741824

Method Details

format

public static int format(Format fmt,
                         Object[] args,
                         int start,
                         StringBuffer sbuf,
                         FieldPosition fpos)

format

public static int format(Format fmt,
                         Object[] args,
                         int start,
                         Writer dst,
                         FieldPosition fpos)
            throws java.io.IOException

format

public StringBuffer format(Object obj,
                           StringBuffer sbuf,
                           FieldPosition fpos)

format

public int format(Object arg,
                  int start,
                  Writer dst,
                  FieldPosition fpos)
            throws java.io.IOException

format

public int format(Object[] args,
                  int start,
                  StringBuffer sbuf,
                  FieldPosition fpos)

format

public abstract int format(Object[] args,
                           int start,
                           Writer dst,
                           FieldPosition fpos)
            throws java.io.IOException
Format an array of arguments, and write out the result.
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)

getParam

public static int getParam(Object arg,
                           int defaultValue)

getParam

protected static char getParam(int param,
                               char defaultValue,
                               Object[] args,
                               int start)

getParam

protected static int getParam(int param,
                              int defaultValue,
                              Object[] args,
                              int start)

nextArg

public static int nextArg(int result)

parseObject

public Object parseObject(String text,
                          java.text.ParsePosition status)

print

public static void print(Writer dst,
                         String str)
            throws java.io.IOException

result

public static int result(int resultCode,
                         int nextArg)

resultCode

public static int resultCode(int result)