Class ECIStringBuilder


  • public final class ECIStringBuilder
    extends java.lang.Object
    Class that converts a sequence of ECIs and bytes into a string
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.StringBuilder currentBytes  
      private java.nio.charset.Charset currentCharset  
      private java.lang.StringBuilder result  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void append​(byte value)
      Appends value as a byte value
      void append​(char value)
      Appends value as a byte value
      void append​(int value)
      Append the string repesentation of value (short for append(String.valueOf(value)))
      void append​(java.lang.String value)
      Appends the characters in value as bytes values
      void appendCharacters​(java.lang.StringBuilder value)
      Appends the characters from value (unlike all other append methods of this class who append bytes)
      void appendECI​(int value)
      Appends ECI value to output.
      private void encodeCurrentBytesIfAny()  
      boolean isEmpty()  
      int length()
      Short for toString().length() (if possible, use isEmpty() instead)
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • currentBytes

        private java.lang.StringBuilder currentBytes
      • result

        private java.lang.StringBuilder result
      • currentCharset

        private java.nio.charset.Charset currentCharset
    • Constructor Detail

      • ECIStringBuilder

        public ECIStringBuilder()
      • ECIStringBuilder

        public ECIStringBuilder​(int initialCapacity)
    • Method Detail

      • append

        public void append​(char value)
        Appends value as a byte value
        Parameters:
        value - character whose lowest byte is to be appended
      • append

        public void append​(byte value)
        Appends value as a byte value
        Parameters:
        value - byte to append
      • append

        public void append​(java.lang.String value)
        Appends the characters in value as bytes values
        Parameters:
        value - string to append
      • append

        public void append​(int value)
        Append the string repesentation of value (short for append(String.valueOf(value)))
        Parameters:
        value - int to append as a string
      • appendECI

        public void appendECI​(int value)
                       throws FormatException
        Appends ECI value to output.
        Parameters:
        value - ECI value to append, as an int
        Throws:
        FormatException - on invalid ECI value
      • encodeCurrentBytesIfAny

        private void encodeCurrentBytesIfAny()
      • appendCharacters

        public void appendCharacters​(java.lang.StringBuilder value)
        Appends the characters from value (unlike all other append methods of this class who append bytes)
        Parameters:
        value - characters to append
      • length

        public int length()
        Short for toString().length() (if possible, use isEmpty() instead)
        Returns:
        length of string representation in characters
      • isEmpty

        public boolean isEmpty()
        Returns:
        true iff nothing has been appended
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object