Class ToSpaceEncoderDecoder

  • All Implemented Interfaces:
    EncoderDecoder

    public class ToSpaceEncoderDecoder
    extends Object
    implements EncoderDecoder
    Encoder implementation that replaces newline, carriage return, tab and backslash with a space. This encoder is suitable for use with tab-separated text files. This encoder is non-symmetrical and the decode(String) method simply returns the argument unmodified.
    Since:
    2.15
    Author:
    Nicklas
    • Constructor Detail

      • ToSpaceEncoderDecoder

        public ToSpaceEncoderDecoder()
    • Method Detail

      • isSymmetrical

        public boolean isSymmetrical()
        Specified by:
        isSymmetrical in interface EncoderDecoder
        Returns:
        TRUE if the encoder is symmetrical, FALSE if not
      • decode

        public String decode​(String s)
        Specified by:
        decode in interface EncoderDecoder
        Parameters:
        s - The string to decode
        Returns:
        The decoded string
      • encode

        public String encode​(String s)
        Specified by:
        encode in interface EncoderDecoder
        Parameters:
        s - The string to encode
        Returns:
        The encoded string