Interface FSASerializer
- All Known Implementing Classes:
CFSA2Serializer, FSA5Serializer
public interface FSASerializer
All FSA serializers (to binary formats) will implement this interface.
-
Method Summary
Modifier and TypeMethodDescriptiongetFlags()<T extends OutputStream>
TSerialize a finite state automaton to an output stream.withAnnotationSeparator(byte annotationSeparator) Sets the annotation separator (only ifgetFlags()returnsFSAFlags.SEPARATORS).withFiller(byte filler) Sets the filler separator (only ifgetFlags()returnsFSAFlags.SEPARATORS).Enables support for right language count on nodes, speeding up perfect hash counts (only ifgetFlags()returnsFSAFlags.NUMBERS).
-
Method Details
-
serialize
Serialize a finite state automaton to an output stream.- Type Parameters:
T- A subclass ofOutputStream, returned for chaining.- Parameters:
fsa- The automaton to serialize.os- The output stream to serialize to.- Returns:
- Returns
Tfor chaining. - Throws:
IOException- Rethrown if an I/O error occurs.
-
getFlags
-
withFiller
Sets the filler separator (only ifgetFlags()returnsFSAFlags.SEPARATORS).- Parameters:
filler- The filler separator byte.- Returns:
- Returns
thisfor call chaining.
-
withAnnotationSeparator
Sets the annotation separator (only ifgetFlags()returnsFSAFlags.SEPARATORS).- Parameters:
annotationSeparator- The filler separator byte.- Returns:
- Returns
thisfor call chaining.
-
withNumbers
FSASerializer withNumbers()Enables support for right language count on nodes, speeding up perfect hash counts (only ifgetFlags()returnsFSAFlags.NUMBERS).- Returns:
- Returns
thisfor call chaining.
-