Class Utilities
java.lang.Object
com.aowagie.text.Utilities
A collection of convenience methods that were present in many different iText
classes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Object[][]addToArray(Object[][] original, Object[] item) Utility method to extend an array.static booleancheckTrueOrFalse(Properties attributes, String key) Checks for a true/false value of a key in a Properties object.static intconvertToUtf32(char[] text, int idx) Converts a unicode character in a character array to a UTF 32 code point value.static intconvertToUtf32(char highSurrogate, char lowSurrogate) Returns the code point of a UTF32 character corresponding with a high and a low surrogate value.static intconvertToUtf32(String text, int idx) Converts a unicode character in a String to a UTF32 code point valuestatic booleanisSurrogateHigh(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 booleanisSurrogatePair(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 booleanisSurrogatePair(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 voidskip(InputStream is, int size) This method is an alternative for theInputStream.skip()-method that doesn't seem to work properly for big values ofsize.
-
Constructor Details
-
Utilities
public Utilities()
-
-
Method Details
-
addToArray
-
checkTrueOrFalse
Checks for a true/false value of a key in a Properties object.- Parameters:
attributes- Attributes with propertieskey- Key to search- Returns:
- a true/false value of a key in a Properties object
-
skip
This method is an alternative for theInputStream.skip()-method that doesn't seem to work properly for big values ofsize.- Parameters:
is- theInputStreamsize- the number of bytes to skip- Throws:
IOException- Exception with information about the error
-
isSurrogateHigh
public 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.- Parameters:
c- the character- Returns:
- true if the character belongs to the interval
- Since:
- 2.1.2
-
isSurrogatePair
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).- Parameters:
text- the String with the high and low surrogate charactersidx- the index of the 'high' character in the pair- Returns:
- true if the characters are surrogate pairs
- Since:
- 2.1.2
-
isSurrogatePair
public 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).- Parameters:
text- the character array with the high and low surrogate charactersidx- the index of the 'high' character in the pair- Returns:
- true if the characters are surrogate pairs
- Since:
- 2.1.2
-
convertToUtf32
public static int convertToUtf32(char highSurrogate, char lowSurrogate) Returns the code point of a UTF32 character corresponding with a high and a low surrogate value.- Parameters:
highSurrogate- the high surrogate valuelowSurrogate- the low surrogate value- Returns:
- a code point value
- Since:
- 2.1.2
-
convertToUtf32
public static int convertToUtf32(char[] text, int idx) Converts a unicode character in a character array to a UTF 32 code point value.- Parameters:
text- a character array that has the unicode character(s)idx- the index of the 'high' character- Returns:
- the code point value
- Since:
- 2.1.2
-
convertToUtf32
Converts a unicode character in a String to a UTF32 code point value- Parameters:
text- a String that has the unicode character(s)idx- the index of the 'high' character- Returns:
- the codepoint value
- Since:
- 2.1.2
-