Package com.google.zxing.common
Class ECIStringBuilder
- java.lang.Object
-
- com.google.zxing.common.ECIStringBuilder
-
public final class ECIStringBuilder extends java.lang.ObjectClass that converts a sequence of ECIs and bytes into a string
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringBuildercurrentBytesprivate java.nio.charset.CharsetcurrentCharsetprivate java.lang.StringBuilderresult
-
Constructor Summary
Constructors Constructor Description ECIStringBuilder()ECIStringBuilder(int initialCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(byte value)Appendsvalueas a byte valuevoidappend(char value)Appendsvalueas a byte valuevoidappend(int value)Append the string repesentation ofvalue(short forappend(String.valueOf(value)))voidappend(java.lang.String value)Appends the characters invalueas bytes valuesvoidappendCharacters(java.lang.StringBuilder value)Appends the characters fromvalue(unlike all other append methods of this class who append bytes)voidappendECI(int value)Appends ECI value to output.private voidencodeCurrentBytesIfAny()booleanisEmpty()intlength()Short fortoString().length()(if possible, useisEmpty()instead)java.lang.StringtoString()
-
-
-
Method Detail
-
append
public void append(char value)
Appendsvalueas a byte value- Parameters:
value- character whose lowest byte is to be appended
-
append
public void append(byte value)
Appendsvalueas a byte value- Parameters:
value- byte to append
-
append
public void append(java.lang.String value)
Appends the characters invalueas bytes values- Parameters:
value- string to append
-
append
public void append(int value)
Append the string repesentation ofvalue(short forappend(String.valueOf(value)))- Parameters:
value- int to append as a string
-
appendECI
public void appendECI(int value) throws FormatExceptionAppends 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 fromvalue(unlike all other append methods of this class who append bytes)- Parameters:
value- characters to append
-
length
public int length()
Short fortoString().length()(if possible, useisEmpty()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:
toStringin classjava.lang.Object
-
-