public class Utilities extends Object
| Constructor and Description |
|---|
Utilities() |
| Modifier and Type | Method and Description |
|---|---|
static Object[][] |
addToArray(Object[][] original,
Object[] item)
Utility method to extend an array.
|
static boolean |
checkTrueOrFalse(Properties attributes,
String key)
Checks for a true/false value of a key in a Properties object.
|
static int |
convertToUtf32(char[] text,
int idx)
Converts a unicode character in a character array to a UTF 32 code point value.
|
static int |
convertToUtf32(char highSurrogate,
char lowSurrogate)
Returns the code point of a UTF32 character corresponding with
a high and a low surrogate value.
|
static int |
convertToUtf32(String text,
int idx)
Converts a unicode character in a String to a UTF32 code point value
|
static boolean |
isSurrogateHigh(char c)
Check if the value of a character belongs to a certain interval
that indicates it's the higher part of a surrogate pair.
|
static boolean |
isSurrogatePair(char[] text,
int idx)
Checks if two subsequent characters in a character array are
are the higher and the lower character in a surrogate
pair (and therefore eligible for conversion to a UTF 32 character).
|
static boolean |
isSurrogatePair(String text,
int idx)
Checks if two subsequent characters in a String are
are the higher and the lower character in a surrogate
pair (and therefore eligible for conversion to a UTF 32 character).
|
static void |
skip(InputStream is,
int size)
This method is an alternative for the
InputStream.skip()
-method that doesn't seem to work properly for big values of size
. |
public static Object[][] addToArray(Object[][] original, Object[] item)
original - the original array or nullitem - the item to be added to the arraypublic static boolean checkTrueOrFalse(Properties attributes, String key)
attributes - Attributes with propertieskey - Key to searchpublic static void skip(InputStream is, int size) throws IOException
InputStream.skip()
-method that doesn't seem to work properly for big values of size
.is - the InputStreamsize - the number of bytes to skipIOException - Exception with information about the errorpublic static boolean isSurrogateHigh(char c)
c - the characterpublic static boolean isSurrogatePair(String text, int idx)
text - the String with the high and low surrogate charactersidx - the index of the 'high' character in the pairpublic static boolean isSurrogatePair(char[] text,
int idx)
text - the character array with the high and low surrogate charactersidx - the index of the 'high' character in the pairpublic static int convertToUtf32(char highSurrogate,
char lowSurrogate)
highSurrogate - the high surrogate valuelowSurrogate - the low surrogate valuepublic static int convertToUtf32(char[] text,
int idx)
text - a character array that has the unicode character(s)idx - the index of the 'high' characterpublic static int convertToUtf32(String text, int idx)
text - a String that has the unicode character(s)idx - the index of the 'high' characterCopyright © 2021. All rights reserved.