public class

FormatUtils

extends Object
java.lang.Object
   ↳ org.joda.time.format.FormatUtils

Class Overview

Utility methods used by formatters.

FormatUtils is thread-safe and immutable.

Summary

Public Methods
static void appendPaddedInteger(StringBuffer buf, int value, int size)
Converts an integer to a string, prepended with a variable amount of '0' pad characters, and appends it to the given buffer.
static void appendPaddedInteger(StringBuffer buf, long value, int size)
Converts an integer to a string, prepended with a variable amount of '0' pad characters, and appends it to the given buffer.
static void appendUnpaddedInteger(StringBuffer buf, long value)
Converts an integer to a string, and appends it to the given buffer.
static void appendUnpaddedInteger(StringBuffer buf, int value)
Converts an integer to a string, and appends it to the given buffer.
static int calculateDigitCount(long value)
Calculates the number of decimal digits for the given value, including the sign.
static void writePaddedInteger(Writer out, int value, int size)
Converts an integer to a string, prepended with a variable amount of '0' pad characters, and writes it to the given writer.
static void writePaddedInteger(Writer out, long value, int size)
Converts an integer to a string, prepended with a variable amount of '0' pad characters, and writes it to the given writer.
static void writeUnpaddedInteger(Writer out, long value)
Converts an integer to a string, and writes it to the given writer.
static void writeUnpaddedInteger(Writer out, int value)
Converts an integer to a string, and writes it to the given writer.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static void appendPaddedInteger (StringBuffer buf, int value, int size)

Converts an integer to a string, prepended with a variable amount of '0' pad characters, and appends it to the given buffer.

This method is optimized for converting small values to strings.

Parameters
buf receives integer converted to a string
value value to convert to a string
size minumum amount of digits to append

public static void appendPaddedInteger (StringBuffer buf, long value, int size)

Converts an integer to a string, prepended with a variable amount of '0' pad characters, and appends it to the given buffer.

This method is optimized for converting small values to strings.

Parameters
buf receives integer converted to a string
value value to convert to a string
size minumum amount of digits to append

public static void appendUnpaddedInteger (StringBuffer buf, long value)

Converts an integer to a string, and appends it to the given buffer.

This method is optimized for converting small values to strings.

Parameters
buf receives integer converted to a string
value value to convert to a string

public static void appendUnpaddedInteger (StringBuffer buf, int value)

Converts an integer to a string, and appends it to the given buffer.

This method is optimized for converting small values to strings.

Parameters
buf receives integer converted to a string
value value to convert to a string

public static int calculateDigitCount (long value)

Calculates the number of decimal digits for the given value, including the sign.

public static void writePaddedInteger (Writer out, int value, int size)

Converts an integer to a string, prepended with a variable amount of '0' pad characters, and writes it to the given writer.

This method is optimized for converting small values to strings.

Parameters
out receives integer converted to a string
value value to convert to a string
size minumum amount of digits to append
Throws
IOException

public static void writePaddedInteger (Writer out, long value, int size)

Converts an integer to a string, prepended with a variable amount of '0' pad characters, and writes it to the given writer.

This method is optimized for converting small values to strings.

Parameters
out receives integer converted to a string
value value to convert to a string
size minumum amount of digits to append
Throws
IOException

public static void writeUnpaddedInteger (Writer out, long value)

Converts an integer to a string, and writes it to the given writer.

This method is optimized for converting small values to strings.

Parameters
out receives integer converted to a string
value value to convert to a string
Throws
IOException

public static void writeUnpaddedInteger (Writer out, int value)

Converts an integer to a string, and writes it to the given writer.

This method is optimized for converting small values to strings.

Parameters
out receives integer converted to a string
value value to convert to a string
Throws
IOException