Package hec.io
Class AsciiSerializer
java.lang.Object
hec.io.AsciiSerializer
- All Implemented Interfaces:
AsciiSerializableConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static boolean
protected static int
protected BufferedWriter
protected StringBuffer
protected static boolean
protected String
Fields inherited from interface hec.io.AsciiSerializableConstants
ARRAY, BEGIN, BEGIN_ARRAY, BEGIN_COLLECTION, BEGIN_ENUM_TYPE, BEGIN_HASH, BEGIN_MAP, BEGIN_OBJECT, BEGIN_VECTOR, BOOLEAN, BOOLEAN_TYPE, BYTE, BYTE_TYPE, CHAR, CHAR_TYPE, CLASS, DELIM, DOUBLE, DOUBLE_TYPE, DSSFILEPATH, DSSPATH, END, END_ARRAY, END_COLLECTION, END_ENUM_TYPE, END_HASH, END_MAP, END_OBJECT, END_VECTOR, FIELD, FILEPATH, FLOAT, FLOAT_TYPE, HEADER, ID, INT, INT_TYPE, LONG, LONG_TYPE, NAN, NEGATIVE_INFINITY, OBJECT_ARRAY, OLD_BEGIN, OLD_BEGIN_ARRAY, OLD_BEGIN_HASH, OLD_BEGIN_OBJECT, OLD_BEGIN_VECTOR, OLD_END, OLD_END_ARRAY, OLD_END_HASH, OLD_END_OBJECT, OLD_END_VECTOR, OLD_FIELD, OLD_REFERENCE, OLD_STRING, OLD_VALUE, POSITIVE_INFINITY, REFERENCE, SHORT, SHORT_TYPE, STRING, VALUE, VOID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Integer
addTableObject
(Object obj) Returns an Integer holding the index value for the given objectprotected void
decrease indentation in fileprotected Object
getFieldObject
(AsciiSerializable obj, Field field, int mods) protected Integer
returns an Integer holding the index value for the given object, null if object is not in tableprotected void
Increase indentation in filevoid
reset
(BufferedWriter out) reset this Serializer to a new BufferedWriterboolean
serializeObject
(Object obj) Stores an object in ascii format to a file.protected void
writeArray
(Object obj) write an array objectprotected void
writeEnumData
(Object enumObject) protected boolean
writeField
(AsciiSerializable obj, Field field) protected boolean
writeField
(Field fld, Object obj) protected void
writeFields
(AsciiSerializable obj, Field[] declaredFields) protected void
protected void
writeObject
(Object obj) Stores an object in ascii format to a fileprotected boolean
writeObjectFields
(Object obj) Writes all accessible fields of the given object, recursing into contained objects.protected void
write a PairedValues Objectprotected void
protected void
writeTypeParamLine
(String type, String param)
-
Field Details
-
_out
-
_strIndent
-
_outLine
-
_maxArraySize
protected static int _maxArraySize -
_formatFile
protected static boolean _formatFile -
_showTiming
protected static boolean _showTiming
-
-
Constructor Details
-
AsciiSerializer
-
-
Method Details
-
reset
reset this Serializer to a new BufferedWriter -
serializeObject
Stores an object in ascii format to a file. ignoring arrays and primitives for now -
writeHeader
protected void writeHeader() -
writeObjectFields
Writes all accessible fields of the given object, recursing into contained objects.- Throws:
IOException
-
writeField
- Throws:
IOException
-
getTableObjectIndex
returns an Integer holding the index value for the given object, null if object is not in table -
addTableObject
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
Stores an object in ascii format to a file- Throws:
IOException
-
writePairedValues
write a PairedValues Object- Throws:
IOException
-
getFieldObject
-
writeTypeParamLine
- Throws:
IOException
-
writeTextFileReference
- Throws:
IOException
-
writeFields
- Throws:
IOException
-
writeField
- Throws:
IOException
-
writeArray
write an array object- Throws:
IOException
-
writeEnumData
- Throws:
IOException
-