jwo.utils.dbase
Class DbaseFileWriter.FieldFormatter

java.lang.Object
  extended by jwo.utils.dbase.DbaseFileWriter.FieldFormatter
Enclosing class:
DbaseFileWriter

public static class DbaseFileWriter.FieldFormatter
extends Object

Utility for formatting Dbase fields.


Constructor Summary
DbaseFileWriter.FieldFormatter()
          Creates the field formatter.
 
Method Summary
 String getFieldString(Date d)
          Reports the field string representing the given date.
 String getFieldString(int size, int decimalPlaces, Number n)
          Reports the field string representation of a number to a given number of decimal places.
 String getFieldString(int size, String s)
          Reports the field string set to the given size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbaseFileWriter.FieldFormatter

public DbaseFileWriter.FieldFormatter()
Creates the field formatter.

Method Detail

getFieldString

public String getFieldString(int size,
                             String s)
Reports the field string set to the given size.

Parameters:
size - Size to set the field string to be.
s - String to set to the given size.
Returns:
New field string set to the given size.

getFieldString

public String getFieldString(Date d)
Reports the field string representing the given date.

Parameters:
d - Date to represent.
Returns:
Field string representation of the given date.

getFieldString

public String getFieldString(int size,
                             int decimalPlaces,
                             Number n)
Reports the field string representation of a number to a given number of decimal places.

Parameters:
size - Size to set the string representation of the number.
decimalPlaces - Number of decimal places to report the number.
n - The number to represent as a field string.
Returns:
Text representation of the number.


Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009