Package convex.core.text
Class Text
java.lang.Object
convex.core.text.Text
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcolumnCount(String text) static StringdateFormat(long timestamp) static booleanisASCIIDigit(char c) Return true if the character is an ASCII numeric digitstatic StringleftPad(long value, int length) static Stringstatic intstatic Stringrepeat(char c, int count) static StringrightPad(long value, int length) static Stringstatic StringtoFriendlyBalance(long balance) Format function for Convex Coin balancesstatic StringtoFriendlyDecimal(double value) static StringtoFriendlyIntString(double value) static StringtoFriendlyNumber(long value) static StringtoPercentString(double value) static StringwhiteSpace(int length) static voidwriteEscapedByte(BlobBuilder sb, byte b) Writes a UTF-8 byte, escaped as necessary for Java.static StringzeroPad(BigInteger b, int digits) Zero pads a positive integer out to the specified number of digits
-
Constructor Details
-
Text
public Text()
-
-
Method Details
-
isASCIIDigit
public static boolean isASCIIDigit(char c) Return true if the character is an ASCII numeric digit- Parameters:
c- Character to test- Returns:
- True if ASCII digit, false otherwise
-
whiteSpace
-
leftPad
-
leftPad
-
rightPad
-
rightPad
-
toFriendlyNumber
-
toPercentString
-
toFriendlyDecimal
-
toFriendlyIntString
-
toFriendlyBalance
Format function for Convex Coin balances- Parameters:
balance- Balance in Convex Coins- Returns:
- Formatted String like "12.000567123"
-
dateFormat
-
writeEscapedByte
Writes a UTF-8 byte, escaped as necessary for Java. This works because only single byte ASCII characters need escaping.- Parameters:
sb- BlobBuilder to append UTF-8 bytesb- Byte to write
-
lineCount
-
columnCount
-
zeroPad
Zero pads a positive integer out to the specified number of digits- Parameters:
b- Integer to paddigits- Number of digits desired- Returns:
- String representation of Integer
-
repeat
-