net.sf.ffo
Class FixedFormatWritter

java.lang.Object
  extended by net.sf.ffo.FixedFormatWritter

public class FixedFormatWritter
extends java.lang.Object

Simple class to help writing fixed sized fields.

Version:
$Id: FixedFormatWritter.java,v 1.7 2005/12/26 05:33:26 mikkey Exp $
Author:
mgriffa

Constructor Summary
FixedFormatWritter(java.io.Writer writer)
           
 
Method Summary
 java.io.Writer getWriter()
           
 void write(java.util.Calendar cal)
          Warning: this method uses intenally SimpleDateFormat with all its limitations
 void write(java.lang.Double field, int integerCount, int decimalCount)
          Write the double with specified amount of characters for integer part and decimal part.
 void write(java.lang.Integer val, int len)
           
 void write(int val, int len)
           
 void write(java.lang.Long val, int len)
           
 void write(java.lang.String fmt, java.util.Calendar cal)
          Warning: this method uses intenally SimpleDateFormat with all its limitations
 void write(java.lang.String val, int len)
           
 void write(java.lang.String val, int len, char pad, boolean alignRight)
          Writes the value with given format parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedFormatWritter

public FixedFormatWritter(java.io.Writer writer)
Method Detail

write

public void write(java.lang.Integer val,
                  int len)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(int val,
                  int len)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(java.lang.Long val,
                  int len)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(java.lang.String val,
                  int len)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(java.lang.String val,
                  int len,
                  char pad,
                  boolean alignRight)
           throws java.io.IOException
Writes the value with given format parameters.

Parameters:
val - the value to write
len - length to use for the field, must be equal or greater than val.length()
pad - the padding character to use
alignRight - flag to align the value to the right (otherwise is left)
Throws:
java.io.IOException

write

public void write(java.util.Calendar cal)
           throws java.io.IOException
Warning: this method uses intenally SimpleDateFormat with all its limitations

Parameters:
cal -
Throws:
java.io.IOException

write

public void write(java.lang.Double field,
                  int integerCount,
                  int decimalCount)
           throws java.io.IOException
Write the double with specified amount of characters for integer part and decimal part. no decimal separator is written.

Parameters:
field - the value to format
integerCount -
decimalCount -
Throws:
java.io.IOException

write

public void write(java.lang.String fmt,
                  java.util.Calendar cal)
           throws java.io.IOException
Warning: this method uses intenally SimpleDateFormat with all its limitations

Parameters:
fmt - the format string to pass to simple date format
cal -
Throws:
java.io.IOException

getWriter

public java.io.Writer getWriter()


Copyright 2006 null. All Rights Reserved.