Package jme3utilities
Class MyString
java.lang.Object
jme3utilities.MyString
Utility methods for char sequences, strings, and collections of strings.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
axisName
(int axisIndex) Describe a coordinate axis.static String
describe
(float fValue) Generate a textual description of a single-precision floating-point value.static String
describeFraction
(float fValue) Generate a textual description of a single-precision floating-point value using at most 3 decimal places.static String
describeMatrix
(Matrix3f matrix) Generate a textual description of a Matrix3f value.static String
escape
(CharSequence unescaped) Replace all tab, quote, newline, and backslash characters in the specified text with escape sequences.static String
firstToLower
(String input) Convert the first character of the specified text to lower case.static String
quote
(CharSequence text) Enclose the specified text in quotation marks and escape all tab, quote, newline, and backslash characters.static String
removeSuffix
(String input, String suffix) Extract the remainder of the specified string after removing the specified suffix.
-
Method Details
-
axisName
Describe a coordinate axis.- Parameters:
axisIndex
- the index of the axis: 0→X, 1→Y, 2→Z- Returns:
- a textual description (not null, not empty)
-
describe
Generate a textual description of a single-precision floating-point value.- Parameters:
fValue
- the value to describe- Returns:
- a description (not null, not empty)
-
describeFraction
Generate a textual description of a single-precision floating-point value using at most 3 decimal places.- Parameters:
fValue
- the value to describe- Returns:
- a description (not null, not empty)
-
describeMatrix
Generate a textual description of a Matrix3f value.- Parameters:
matrix
- the value to describe (may be null, unaffected)- Returns:
- a description (not null, not empty)
-
escape
Replace all tab, quote, newline, and backslash characters in the specified text with escape sequences.- Parameters:
unescaped
- the input text to escape (not null)- Returns:
- the escaped text (not null)
-
firstToLower
Convert the first character of the specified text to lower case.- Parameters:
input
- the input text to convert (not null)- Returns:
- the converted text (not null)
-
quote
Enclose the specified text in quotation marks and escape all tab, quote, newline, and backslash characters.- Parameters:
text
- the input text to quote- Returns:
- the quoted text, or "null" if the input was null
-
removeSuffix
Extract the remainder of the specified string after removing the specified suffix.- Parameters:
input
- the input string (not null)suffix
- the suffix string (not null)- Returns:
- the remainder of the input (not null)
-