edu.iris.Fissures.seed.container
Class DataFormat

java.lang.Object
  extended by edu.iris.Fissures.seed.container.DataFormat

public abstract class DataFormat
extends java.lang.Object

Factory class for processing numeric formatting of Strings, using the provided format string.

Author:
Kevin Frechette, ISTI

Field Summary
protected  java.text.DecimalFormat df
          The decimal format.
 
Constructor Summary
DataFormat(java.text.DecimalFormat df)
           
 
Method Summary
static void clearCache()
          Clears the data format map and all of the formatted value maps.
 java.lang.String format(java.lang.Object obj)
          Formats an object to produce a string.
static DataFormat getDataFormat(java.lang.String fmtString)
          Get the data format for the specified format string.
static DataFormat getDataFormat(java.lang.String fmtString, boolean plusPrefixFlag)
          Get the data format for the specified format string.
protected  java.lang.String getFmtVal(java.lang.Object obj)
          Formats an object to produce a string.
protected abstract  java.lang.String getFmtVal(java.lang.String s)
          Formats the number text to produce a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

df

protected final java.text.DecimalFormat df
The decimal format.

Constructor Detail

DataFormat

public DataFormat(java.text.DecimalFormat df)
Method Detail

clearCache

public static void clearCache()
Clears the data format map and all of the formatted value maps. This can be done after loading all the input files.


getDataFormat

public static DataFormat getDataFormat(java.lang.String fmtString)
Get the data format for the specified format string.

Parameters:
fmtString - the format string.
Returns:
the data format.

getDataFormat

public static DataFormat getDataFormat(java.lang.String fmtString,
                                       boolean plusPrefixFlag)
Get the data format for the specified format string.

Parameters:
fmtString - the format string.
plusPrefixFlag - true to use plus sign for a positive prefix, false otherwise.
Returns:
the data format.

format

public java.lang.String format(java.lang.Object obj)
Formats an object to produce a string.

Parameters:
obj - Formats an object to produce a string.
Returns:
Formatted string.

getFmtVal

protected java.lang.String getFmtVal(java.lang.Object obj)
Formats an object to produce a string.

Parameters:
obj - Formats an object to produce a string.
Returns:
Formatted string.

getFmtVal

protected abstract java.lang.String getFmtVal(java.lang.String s)
Formats the number text to produce a string.

Parameters:
s - the number text.
Returns:
Formatted string.