Interface FSASerializer

  • All Known Implementing Classes:
    CFSA2Serializer, FSA5Serializer

    public interface FSASerializer
    All FSA serializers (to binary formats) will implement this interface.
    • Method Detail

      • serialize

        <T extends java.io.OutputStream> T serialize​(FSA fsa,
                                                     T os)
                                              throws java.io.IOException
        Serialize a finite state automaton to an output stream.
        Type Parameters:
        T - A subclass of OutputStream, returned for chaining.
        Parameters:
        fsa - The automaton to serialize.
        os - The output stream to serialize to.
        Returns:
        Returns T for chaining.
        Throws:
        java.io.IOException - Rethrown if an I/O error occurs.
      • getFlags

        java.util.Set<FSAFlags> getFlags()
        Returns:
        Returns the set of flags supported by the serializer (and the output automaton).
      • withFiller

        FSASerializer withFiller​(byte filler)
        Sets the filler separator (only if getFlags() returns FSAFlags.SEPARATORS).
        Parameters:
        filler - The filler separator byte.
        Returns:
        Returns this for call chaining.
      • withAnnotationSeparator

        FSASerializer withAnnotationSeparator​(byte annotationSeparator)
        Sets the annotation separator (only if getFlags() returns FSAFlags.SEPARATORS).
        Parameters:
        annotationSeparator - The filler separator byte.
        Returns:
        Returns this for call chaining.
      • withNumbers

        FSASerializer withNumbers()
        Enables support for right language count on nodes, speeding up perfect hash counts (only if getFlags() returns FSAFlags.NUMBERS).
        Returns:
        Returns this for call chaining.