Package com.adobe.agl.impl
Class Utility
java.lang.Object
com.adobe.agl.impl.Utility
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringBufferappendNumber(StringBuffer result, int n) Append a number to the given StringBuffer in the radix 10 generating at least one digit.static StringBufferappendNumber(StringBuffer result, int n, int radix, int minDigits) Append a number to the given StringBuffer in the given radix.static Stringhex(char ch) Convert a char to 4 hex uppercase digits.static StringBufferhex(char ch, StringBuffer output) Convert a char to 4 hex uppercase digits.static Stringhex(int ch, int width) Convert a integer to size width (minimum) hex uppercase digits.static StringBufferhex(int ch, int width, StringBuffer output) Convert a integer to size width hex uppercase digits.static Stringhex(long ch) static Stringhex(long i, int places) Supplies a zero-padded hex representation of an integer (without 0x)static StringConvert a string to comma-separated groups of 4 hex uppercase digits.static Stringhex(StringBuffer s) Convert a string to comma-separated groups of 4 hex uppercase digits.static StringBufferhex(String s, StringBuffer result) Convert a string to comma-separated groups of 4 hex uppercase digits.
-
Constructor Details
-
Utility
public Utility()
-
-
Method Details
-
hex
Convert a char to 4 hex uppercase digits. E.g., hex('a') => "0041". -
hex
Convert a string to comma-separated groups of 4 hex uppercase digits. E.g., hex('ab') => "0041,0042". -
hex
Convert a string to comma-separated groups of 4 hex uppercase digits. E.g., hex('ab') => "0041,0042". -
hex
Convert a char to 4 hex uppercase digits. E.g., hex('a') => "0041". Append the output to the given StringBuffer. -
hex
Convert a integer to size width hex uppercase digits. E.g., hex('a', 4, str) => "0041". Append the output to the given StringBuffer. If width is too small to fit, nothing will be appended to output. -
hex
Convert a integer to size width (minimum) hex uppercase digits. E.g., hex('a', 4, str) => "0041". If the integer requires more than width digits, more will be used. -
appendNumber
Append a number to the given StringBuffer in the radix 10 generating at least one digit. -
appendNumber
public static StringBuffer appendNumber(StringBuffer result, int n, int radix, int minDigits) throws IllegalArgumentException Append a number to the given StringBuffer in the given radix. Standard digits '0'-'9' are used and letters 'A'-'Z' for radices 11 through 36.- Parameters:
result- the digits of the number are appended heren- the number to be converted to digits; may be negative. If negative, a '-' is prepended to the digits.radix- a radix from 2 to 36 inclusive.minDigits- the minimum number of digits, not including any '-', to produce. Values less than 2 have no effect. One digit is always emitted regardless of this parameter.- Returns:
- a reference to result
- Throws:
IllegalArgumentException
-
hex
Supplies a zero-padded hex representation of an integer (without 0x) -
hex
-
hex
Convert a string to comma-separated groups of 4 hex uppercase digits. E.g., hex('ab') => "0041,0042". Append the output to the given StringBuffer.
-