public final class FSA5Serializer extends java.lang.Object implements FSASerializer
FSA graphs to a binary format compatible with
Jan Daciuk's fsa's package FSA5 format.
It is possible to serialize the automaton with numbers required for perfect
hashing. See withNumbers() method.
FSA5,
FSA.read(java.io.InputStream)| Modifier and Type | Field and Description |
|---|---|
byte |
annotationByte |
byte |
fillerByte |
| Constructor and Description |
|---|
FSA5Serializer() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<FSAFlags> |
getFlags()
Return supported flags.
|
<T extends java.io.OutputStream> |
serialize(FSA fsa,
T os)
Serialize root state
s to an output stream in
FSA5 format. |
FSA5Serializer |
withAnnotationSeparator(byte annotationSeparator)
Supports built-in annotation separator.
|
FSA5Serializer |
withFiller(byte filler)
Supports built-in filler separator.
|
FSASerializer |
withLogger(IMessageLogger logger)
Log extra messages during construction.
|
FSA5Serializer |
withNumbers()
Serialize the automaton with the number of right-language sequences in
each node.
|
public byte fillerByte
FSA5.fillerpublic byte annotationByte
FSA5.annotationpublic FSA5Serializer withNumbers()
withNumbers in interface FSASerializerpublic FSA5Serializer withFiller(byte filler)
FSASerializer.getFlags() returns
FSAFlags.SEPARATORS.withFiller in interface FSASerializerpublic FSA5Serializer withAnnotationSeparator(byte annotationSeparator)
FSASerializer.getFlags() returns
FSAFlags.SEPARATORS.withAnnotationSeparator in interface FSASerializerpublic FSASerializer withLogger(IMessageLogger logger)
withLogger in interface FSASerializerpublic <T extends java.io.OutputStream> T serialize(FSA fsa, T os) throws java.io.IOException
s to an output stream in
FSA5 format.serialize in interface FSASerializeros for chaining.java.io.IOExceptionwithNumberspublic java.util.Set<FSAFlags> getFlags()
getFlags in interface FSASerializerCopyright © 2013. All Rights Reserved.