com.j256.simplemagic.entries
Class Formatter

java.lang.Object
  extended by com.j256.simplemagic.entries.Formatter

public class Formatter
extends Object

Formatter that handles the C %0.2f type formats appropriately. I would have used the Formatter but you can't pre-parse those for some stupid reason. Also, I needed this to be compatible with the printf(3) C formats.

Author:
graywatson

Constructor Summary
Formatter(String formatString)
          This takes a format string, breaks it up into prefix, %-thang, and suffix.
 
Method Summary
 void format(StringBuilder sb, Object value)
          Formats the extracted value assigned and returns the associated string
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Formatter

public Formatter(String formatString)
This takes a format string, breaks it up into prefix, %-thang, and suffix.

Method Detail

format

public void format(StringBuilder sb,
                   Object value)
Formats the extracted value assigned and returns the associated string


toString

public String toString()
Overrides:
toString in class Object


This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.