Package hec.io

Class AsciiSerializer

java.lang.Object
hec.io.AsciiSerializer
All Implemented Interfaces:
AsciiSerializableConstants

public class AsciiSerializer extends Object implements AsciiSerializableConstants
  • Field Details

    • _out

      protected BufferedWriter _out
    • _strIndent

      protected String _strIndent
    • _outLine

      protected StringBuffer _outLine
    • _maxArraySize

      protected static int _maxArraySize
    • _formatFile

      protected static boolean _formatFile
    • _showTiming

      protected static boolean _showTiming
  • Constructor Details

  • Method Details

    • reset

      public void reset(BufferedWriter out)
      reset this Serializer to a new BufferedWriter
    • serializeObject

      public boolean serializeObject(Object obj)
      Stores an object in ascii format to a file. ignoring arrays and primitives for now
    • writeHeader

      protected void writeHeader()
    • writeObjectFields

      protected boolean writeObjectFields(Object obj) throws IOException
      Writes all accessible fields of the given object, recursing into contained objects.
      Throws:
      IOException
    • writeField

      protected boolean writeField(Field fld, Object obj) throws IOException
      Throws:
      IOException
    • getTableObjectIndex

      protected Integer getTableObjectIndex(Object obj)
      returns an Integer holding the index value for the given object, null if object is not in table
    • addTableObject

      protected Integer addTableObject(Object obj)
      Returns an Integer holding the index value for the given object
    • incrementRecursion

      protected void incrementRecursion()
      Increase indentation in file
    • decrementRecursion

      protected void decrementRecursion()
      decrease indentation in file
    • writeObject

      protected void writeObject(Object obj) throws IOException
      Stores an object in ascii format to a file
      Throws:
      IOException
    • writePairedValues

      protected void writePairedValues(PairedValues pv) throws IOException
      write a PairedValues Object
      Throws:
      IOException
    • getFieldObject

      protected Object getFieldObject(AsciiSerializable obj, Field field, int mods)
    • writeTypeParamLine

      protected void writeTypeParamLine(String type, String param) throws IOException
      Throws:
      IOException
    • writeTextFileReference

      protected void writeTextFileReference(TextFileReference tfr) throws IOException
      Throws:
      IOException
    • writeFields

      protected void writeFields(AsciiSerializable obj, Field[] declaredFields) throws IOException
      Throws:
      IOException
    • writeField

      protected boolean writeField(AsciiSerializable obj, Field field) throws IOException
      Throws:
      IOException
    • writeArray

      protected void writeArray(Object obj) throws IOException
      write an array object
      Throws:
      IOException
    • writeEnumData

      protected void writeEnumData(Object enumObject) throws IOException
      Throws:
      IOException