Java Code Examples for android.icu.lang.UCharacter#MIN_VALUE
The following examples show how to use
android.icu.lang.UCharacter#MIN_VALUE .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UCharacterName.java From j2objc with Apache License 2.0 | 6 votes |
/** * Retrieve the name of a Unicode code point. * Depending on <code>choice</code>, the character name written into the * buffer is the "modern" name or the name that was defined in Unicode * version 1.0. * The name contains only "invariant" characters * like A-Z, 0-9, space, and '-'. * * @param ch the code point for which to get the name. * @param choice Selector for which name to get. * @return if code point is above 0x1fff, null is returned */ public String getName(int ch, int choice) { if (ch < UCharacter.MIN_VALUE || ch > UCharacter.MAX_VALUE || choice > UCharacterNameChoice.CHAR_NAME_CHOICE_COUNT) { return null; } String result = null; result = getAlgName(ch, choice); // getting normal character name if (result == null || result.length() == 0) { if (choice == UCharacterNameChoice.EXTENDED_CHAR_NAME) { result = getExtendedName(ch); } else { result = getGroupName(ch, choice); } } return result; }
Example 2
Source File: UCharacterTest.java From j2objc with Apache License 2.0 | 6 votes |
@Test public void TestToString(){ int[] valid_tests = { UCharacter.MIN_VALUE, UCharacter.MIN_VALUE+1, UCharacter.MAX_VALUE-1, UCharacter.MAX_VALUE}; int[] invalid_tests = { UCharacter.MIN_VALUE-1, UCharacter.MIN_VALUE-2, UCharacter.MAX_VALUE+1, UCharacter.MAX_VALUE+2}; for(int i=0; i< valid_tests.length; i++){ if(UCharacter.toString(valid_tests[i]) == null){ errln("UCharacter.toString(int) was not suppose to return " + "null because it was given a valid parameter. Value passed: " + valid_tests[i] + ". Got null."); } } for(int i=0; i< invalid_tests.length; i++){ if(UCharacter.toString(invalid_tests[i]) != null){ errln("UCharacter.toString(int) was suppose to return " + "null because it was given an invalid parameter. Value passed: " + invalid_tests[i] + ". Got: " + UCharacter.toString(invalid_tests[i])); } } }
Example 3
Source File: TrieBuilder.java From j2objc with Apache License 2.0 | 5 votes |
/** * Checks if the character belongs to a zero block in the trie * @param ch codepoint which data is to be retrieved * @return true if ch is in the zero block */ public boolean isInZeroBlock(int ch) { // valid, uncompacted trie and valid c? if (m_isCompacted_ || ch > UCharacter.MAX_VALUE || ch < UCharacter.MIN_VALUE) { return true; } return m_index_[ch >> SHIFT_] == 0; }
Example 4
Source File: UCharacterName.java From j2objc with Apache License 2.0 | 5 votes |
/** * Sets the information for accessing the algorithmic names * @param rangestart starting code point that lies within this name group * @param rangeend end code point that lies within this name group * @param type algorithm type. There's 2 kinds of algorithmic type. First * which uses code point as part of its name and the other uses * variant postfix strings * @param variant algorithmic variant * @return true if values are valid */ boolean setInfo(int rangestart, int rangeend, byte type, byte variant) { if (rangestart >= UCharacter.MIN_VALUE && rangestart <= rangeend && rangeend <= UCharacter.MAX_VALUE && (type == TYPE_0_ || type == TYPE_1_)) { m_rangestart_ = rangestart; m_rangeend_ = rangeend; m_type_ = type; m_variant_ = variant; return true; } return false; }
Example 5
Source File: UCharacterTest.java From j2objc with Apache License 2.0 | 5 votes |
@Test public void TestGetISOComment(){ int[] invalid_tests = { UCharacter.MIN_VALUE-1, UCharacter.MIN_VALUE-2, UCharacter.MAX_VALUE+1, UCharacter.MAX_VALUE+2}; for(int i=0; i< invalid_tests.length; i++){ if(UCharacter.getISOComment(invalid_tests[i]) != null){ errln("UCharacter.getISOComment(int) was suppose to return " + "null because it was given an invalid parameter. Value passed: " + invalid_tests[i] + ". Got: " + UCharacter.getISOComment(invalid_tests[i])); } } }