Joda Time API

org.joda.time.format
Class FormatUtils

java.lang.Object
  |
  +--org.joda.time.format.FormatUtils

public class FormatUtils
extends java.lang.Object

Utility methods used by formatters.

Author:
Brian S O'Neill

Method Summary
static void appendPaddedInteger(java.lang.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(java.lang.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(java.lang.StringBuffer buf, int value)
          Converts an integer to a string, and appends it to the given buffer.
static void appendUnpaddedInteger(java.lang.StringBuffer buf, long value)
          Converts an integer to a string, and appends it to the given buffer.
static void writePaddedInteger(java.io.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(java.io.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(java.io.Writer out, int value)
          Converts an integer to a string, and writes it to the given writer.
static void writeUnpaddedInteger(java.io.Writer out, long value)
          Converts an integer to a string, and writes it to the given writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

appendPaddedInteger

public static void appendPaddedInteger(java.lang.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

appendPaddedInteger

public static void appendPaddedInteger(java.lang.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

writePaddedInteger

public static void writePaddedInteger(java.io.Writer out,
                                      int value,
                                      int size)
                               throws java.io.IOException
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
java.io.IOException

writePaddedInteger

public static void writePaddedInteger(java.io.Writer out,
                                      long value,
                                      int size)
                               throws java.io.IOException
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
java.io.IOException

appendUnpaddedInteger

public static void appendUnpaddedInteger(java.lang.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

appendUnpaddedInteger

public static void appendUnpaddedInteger(java.lang.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

writeUnpaddedInteger

public static void writeUnpaddedInteger(java.io.Writer out,
                                        int value)
                                 throws java.io.IOException
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
java.io.IOException

writeUnpaddedInteger

public static void writeUnpaddedInteger(java.io.Writer out,
                                        long value)
                                 throws java.io.IOException
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
java.io.IOException

Joda Time API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.