Class TypeFormat

java.lang.Object
org.codehaus.plexus.util.TypeFormat

public final class TypeFormat extends Object

This class provides utility methods to parse CharSequence into primitive types and to format primitive types into StringBuffer.

Methods from this utility class do not create temporary objects and are typically faster than standard library methods (e.g parseDouble(java.lang.CharSequence) is up to 15x faster than Double.parseDouble).

For class instances, formatting is typically performed using specialized java.text.Format (Locale sensitive) and/or using conventional methods (class sensitive). For example:
     public class Foo {
         public static Foo valueOf(CharSequence chars) {...} // Parses.
         public StringBuffer appendTo(StringBuffer sb) {...} // Formats.
         public String toString() {
             return appendTo(new StringBuffer()).toString();
         }
     }
 

This class is public domain (not copyrighted).

Version:
4.6, June 22, 2003
Author:
Jean-Marie Dautelle