sun.text.normalizer.UTF16 Java Examples
The following examples show how to use
sun.text.normalizer.UTF16.
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: StringPrep.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
private StringBuffer map( UCharacterIterator iter, int options) throws ParseException { Values val = new Values(); char result = 0; int ch = UCharacterIterator.DONE; StringBuffer dest = new StringBuffer(); boolean allowUnassigned = ((options & ALLOW_UNASSIGNED)>0); while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){ result = getCodePointValue(ch); getValues(result,val); // check if the source codepoint is unassigned if(val.type == UNASSIGNED && allowUnassigned == false){ throw new ParseException("An unassigned code point was found in the input " + iter.getText(), iter.getIndex()); }else if((val.type == MAP)){ int index, length; if(val.isIndex){ index = val.value; if(index >= indexes[ONE_UCHAR_MAPPING_INDEX_START] && index < indexes[TWO_UCHARS_MAPPING_INDEX_START]){ length = 1; }else if(index >= indexes[TWO_UCHARS_MAPPING_INDEX_START] && index < indexes[THREE_UCHARS_MAPPING_INDEX_START]){ length = 2; }else if(index >= indexes[THREE_UCHARS_MAPPING_INDEX_START] && index < indexes[FOUR_UCHARS_MAPPING_INDEX_START]){ length = 3; }else{ length = mappingData[index++]; } /* copy mapping to destination */ dest.append(mappingData,index,length); continue; }else{ ch -= val.value; } }else if(val.type == DELETE){ // just consume the codepoint and contine continue; } //copy the source into destination UTF16.append(dest,ch); } return dest; }
Example #2
Source File: StringPrep.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
private StringBuffer map( UCharacterIterator iter, int options) throws ParseException { Values val = new Values(); char result = 0; int ch = UCharacterIterator.DONE; StringBuffer dest = new StringBuffer(); boolean allowUnassigned = ((options & ALLOW_UNASSIGNED)>0); while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){ result = getCodePointValue(ch); getValues(result,val); // check if the source codepoint is unassigned if(val.type == UNASSIGNED && allowUnassigned == false){ throw new ParseException("An unassigned code point was found in the input " + iter.getText(), iter.getIndex()); }else if((val.type == MAP)){ int index, length; if(val.isIndex){ index = val.value; if(index >= indexes[ONE_UCHAR_MAPPING_INDEX_START] && index < indexes[TWO_UCHARS_MAPPING_INDEX_START]){ length = 1; }else if(index >= indexes[TWO_UCHARS_MAPPING_INDEX_START] && index < indexes[THREE_UCHARS_MAPPING_INDEX_START]){ length = 2; }else if(index >= indexes[THREE_UCHARS_MAPPING_INDEX_START] && index < indexes[FOUR_UCHARS_MAPPING_INDEX_START]){ length = 3; }else{ length = mappingData[index++]; } /* copy mapping to destination */ dest.append(mappingData,index,length); continue; }else{ ch -= val.value; } }else if(val.type == DELETE){ // just consume the codepoint and contine continue; } //copy the source into destination UTF16.append(dest,ch); } return dest; }
Example #3
Source File: StringPrep.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
private StringBuffer map( UCharacterIterator iter, int options) throws ParseException { Values val = new Values(); char result = 0; int ch = UCharacterIterator.DONE; StringBuffer dest = new StringBuffer(); boolean allowUnassigned = ((options & ALLOW_UNASSIGNED)>0); while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){ result = getCodePointValue(ch); getValues(result,val); // check if the source codepoint is unassigned if(val.type == UNASSIGNED && allowUnassigned == false){ throw new ParseException("An unassigned code point was found in the input " + iter.getText(), iter.getIndex()); }else if((val.type == MAP)){ int index, length; if(val.isIndex){ index = val.value; if(index >= indexes[ONE_UCHAR_MAPPING_INDEX_START] && index < indexes[TWO_UCHARS_MAPPING_INDEX_START]){ length = 1; }else if(index >= indexes[TWO_UCHARS_MAPPING_INDEX_START] && index < indexes[THREE_UCHARS_MAPPING_INDEX_START]){ length = 2; }else if(index >= indexes[THREE_UCHARS_MAPPING_INDEX_START] && index < indexes[FOUR_UCHARS_MAPPING_INDEX_START]){ length = 3; }else{ length = mappingData[index++]; } /* copy mapping to destination */ dest.append(mappingData,index,length); continue; }else{ ch -= val.value; } }else if(val.type == DELETE){ // just consume the codepoint and contine continue; } //copy the source into destination UTF16.append(dest,ch); } return dest; }
Example #4
Source File: StringPrep.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
private StringBuffer map( UCharacterIterator iter, int options) throws ParseException { Values val = new Values(); char result = 0; int ch = UCharacterIterator.DONE; StringBuffer dest = new StringBuffer(); boolean allowUnassigned = ((options & ALLOW_UNASSIGNED)>0); while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){ result = getCodePointValue(ch); getValues(result,val); // check if the source codepoint is unassigned if(val.type == UNASSIGNED && allowUnassigned == false){ throw new ParseException("An unassigned code point was found in the input " + iter.getText(), iter.getIndex()); }else if((val.type == MAP)){ int index, length; if(val.isIndex){ index = val.value; if(index >= indexes[ONE_UCHAR_MAPPING_INDEX_START] && index < indexes[TWO_UCHARS_MAPPING_INDEX_START]){ length = 1; }else if(index >= indexes[TWO_UCHARS_MAPPING_INDEX_START] && index < indexes[THREE_UCHARS_MAPPING_INDEX_START]){ length = 2; }else if(index >= indexes[THREE_UCHARS_MAPPING_INDEX_START] && index < indexes[FOUR_UCHARS_MAPPING_INDEX_START]){ length = 3; }else{ length = mappingData[index++]; } /* copy mapping to destination */ dest.append(mappingData,index,length); continue; }else{ ch -= val.value; } }else if(val.type == DELETE){ // just consume the codepoint and contine continue; } //copy the source into destination UTF16.append(dest,ch); } return dest; }
Example #5
Source File: StringPrep.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
private StringBuffer map( UCharacterIterator iter, int options) throws ParseException { Values val = new Values(); char result = 0; int ch = UCharacterIterator.DONE; StringBuffer dest = new StringBuffer(); boolean allowUnassigned = ((options & ALLOW_UNASSIGNED)>0); while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){ result = getCodePointValue(ch); getValues(result,val); // check if the source codepoint is unassigned if(val.type == UNASSIGNED && allowUnassigned == false){ throw new ParseException("An unassigned code point was found in the input " + iter.getText(), iter.getIndex()); }else if((val.type == MAP)){ int index, length; if(val.isIndex){ index = val.value; if(index >= indexes[ONE_UCHAR_MAPPING_INDEX_START] && index < indexes[TWO_UCHARS_MAPPING_INDEX_START]){ length = 1; }else if(index >= indexes[TWO_UCHARS_MAPPING_INDEX_START] && index < indexes[THREE_UCHARS_MAPPING_INDEX_START]){ length = 2; }else if(index >= indexes[THREE_UCHARS_MAPPING_INDEX_START] && index < indexes[FOUR_UCHARS_MAPPING_INDEX_START]){ length = 3; }else{ length = mappingData[index++]; } /* copy mapping to destination */ dest.append(mappingData,index,length); continue; }else{ ch -= val.value; } }else if(val.type == DELETE){ // just consume the codepoint and contine continue; } //copy the source into destination UTF16.append(dest,ch); } return dest; }
Example #6
Source File: StringPrep.java From Bytecoder with Apache License 2.0 | 4 votes |
private StringBuffer map( UCharacterIterator iter, int options) throws ParseException { Values val = new Values(); char result = 0; int ch = UCharacterIterator.DONE; StringBuffer dest = new StringBuffer(); boolean allowUnassigned = ((options & ALLOW_UNASSIGNED)>0); while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){ result = getCodePointValue(ch); getValues(result,val); // check if the source codepoint is unassigned if(val.type == UNASSIGNED && allowUnassigned == false){ throw new ParseException("An unassigned code point was found in the input " + iter.getText(), iter.getIndex()); }else if((val.type == MAP)){ int index, length; if(val.isIndex){ index = val.value; if(index >= indexes[ONE_UCHAR_MAPPING_INDEX_START] && index < indexes[TWO_UCHARS_MAPPING_INDEX_START]){ length = 1; }else if(index >= indexes[TWO_UCHARS_MAPPING_INDEX_START] && index < indexes[THREE_UCHARS_MAPPING_INDEX_START]){ length = 2; }else if(index >= indexes[THREE_UCHARS_MAPPING_INDEX_START] && index < indexes[FOUR_UCHARS_MAPPING_INDEX_START]){ length = 3; }else{ length = mappingData[index++]; } /* copy mapping to destination */ dest.append(mappingData,index,length); continue; }else{ ch -= val.value; } }else if(val.type == DELETE){ // just consume the codepoint and contine continue; } //copy the source into destination UTF16.append(dest,ch); } return dest; }
Example #7
Source File: StringPrep.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
private StringBuffer map( UCharacterIterator iter, int options) throws ParseException { Values val = new Values(); char result = 0; int ch = UCharacterIterator.DONE; StringBuffer dest = new StringBuffer(); boolean allowUnassigned = ((options & ALLOW_UNASSIGNED)>0); while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){ result = getCodePointValue(ch); getValues(result,val); // check if the source codepoint is unassigned if(val.type == UNASSIGNED && allowUnassigned == false){ throw new ParseException("An unassigned code point was found in the input " + iter.getText(), iter.getIndex()); }else if((val.type == MAP)){ int index, length; if(val.isIndex){ index = val.value; if(index >= indexes[ONE_UCHAR_MAPPING_INDEX_START] && index < indexes[TWO_UCHARS_MAPPING_INDEX_START]){ length = 1; }else if(index >= indexes[TWO_UCHARS_MAPPING_INDEX_START] && index < indexes[THREE_UCHARS_MAPPING_INDEX_START]){ length = 2; }else if(index >= indexes[THREE_UCHARS_MAPPING_INDEX_START] && index < indexes[FOUR_UCHARS_MAPPING_INDEX_START]){ length = 3; }else{ length = mappingData[index++]; } /* copy mapping to destination */ dest.append(mappingData,index,length); continue; }else{ ch -= val.value; } }else if(val.type == DELETE){ // just consume the codepoint and contine continue; } //copy the source into destination UTF16.append(dest,ch); } return dest; }
Example #8
Source File: StringPrep.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
private StringBuffer map( UCharacterIterator iter, int options) throws ParseException { Values val = new Values(); char result = 0; int ch = UCharacterIterator.DONE; StringBuffer dest = new StringBuffer(); boolean allowUnassigned = ((options & ALLOW_UNASSIGNED)>0); while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){ result = getCodePointValue(ch); getValues(result,val); // check if the source codepoint is unassigned if(val.type == UNASSIGNED && allowUnassigned == false){ throw new ParseException("An unassigned code point was found in the input " + iter.getText(), iter.getIndex()); }else if((val.type == MAP)){ int index, length; if(val.isIndex){ index = val.value; if(index >= indexes[ONE_UCHAR_MAPPING_INDEX_START] && index < indexes[TWO_UCHARS_MAPPING_INDEX_START]){ length = 1; }else if(index >= indexes[TWO_UCHARS_MAPPING_INDEX_START] && index < indexes[THREE_UCHARS_MAPPING_INDEX_START]){ length = 2; }else if(index >= indexes[THREE_UCHARS_MAPPING_INDEX_START] && index < indexes[FOUR_UCHARS_MAPPING_INDEX_START]){ length = 3; }else{ length = mappingData[index++]; } /* copy mapping to destination */ dest.append(mappingData,index,length); continue; }else{ ch -= val.value; } }else if(val.type == DELETE){ // just consume the codepoint and contine continue; } //copy the source into destination UTF16.append(dest,ch); } return dest; }
Example #9
Source File: StringPrep.java From hottub with GNU General Public License v2.0 | 4 votes |
private StringBuffer map( UCharacterIterator iter, int options) throws ParseException { Values val = new Values(); char result = 0; int ch = UCharacterIterator.DONE; StringBuffer dest = new StringBuffer(); boolean allowUnassigned = ((options & ALLOW_UNASSIGNED)>0); while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){ result = getCodePointValue(ch); getValues(result,val); // check if the source codepoint is unassigned if(val.type == UNASSIGNED && allowUnassigned == false){ throw new ParseException("An unassigned code point was found in the input " + iter.getText(), iter.getIndex()); }else if((val.type == MAP)){ int index, length; if(val.isIndex){ index = val.value; if(index >= indexes[ONE_UCHAR_MAPPING_INDEX_START] && index < indexes[TWO_UCHARS_MAPPING_INDEX_START]){ length = 1; }else if(index >= indexes[TWO_UCHARS_MAPPING_INDEX_START] && index < indexes[THREE_UCHARS_MAPPING_INDEX_START]){ length = 2; }else if(index >= indexes[THREE_UCHARS_MAPPING_INDEX_START] && index < indexes[FOUR_UCHARS_MAPPING_INDEX_START]){ length = 3; }else{ length = mappingData[index++]; } /* copy mapping to destination */ dest.append(mappingData,index,length); continue; }else{ ch -= val.value; } }else if(val.type == DELETE){ // just consume the codepoint and contine continue; } //copy the source into destination UTF16.append(dest,ch); } return dest; }
Example #10
Source File: StringPrep.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
private StringBuffer map( UCharacterIterator iter, int options) throws ParseException { Values val = new Values(); char result = 0; int ch = UCharacterIterator.DONE; StringBuffer dest = new StringBuffer(); boolean allowUnassigned = ((options & ALLOW_UNASSIGNED)>0); while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){ result = getCodePointValue(ch); getValues(result,val); // check if the source codepoint is unassigned if(val.type == UNASSIGNED && allowUnassigned == false){ throw new ParseException("An unassigned code point was found in the input " + iter.getText(), iter.getIndex()); }else if((val.type == MAP)){ int index, length; if(val.isIndex){ index = val.value; if(index >= indexes[ONE_UCHAR_MAPPING_INDEX_START] && index < indexes[TWO_UCHARS_MAPPING_INDEX_START]){ length = 1; }else if(index >= indexes[TWO_UCHARS_MAPPING_INDEX_START] && index < indexes[THREE_UCHARS_MAPPING_INDEX_START]){ length = 2; }else if(index >= indexes[THREE_UCHARS_MAPPING_INDEX_START] && index < indexes[FOUR_UCHARS_MAPPING_INDEX_START]){ length = 3; }else{ length = mappingData[index++]; } /* copy mapping to destination */ dest.append(mappingData,index,length); continue; }else{ ch -= val.value; } }else if(val.type == DELETE){ // just consume the codepoint and contine continue; } //copy the source into destination UTF16.append(dest,ch); } return dest; }
Example #11
Source File: StringPrep.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
private StringBuffer map( UCharacterIterator iter, int options) throws ParseException { Values val = new Values(); char result = 0; int ch = UCharacterIterator.DONE; StringBuffer dest = new StringBuffer(); boolean allowUnassigned = ((options & ALLOW_UNASSIGNED)>0); while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){ result = getCodePointValue(ch); getValues(result,val); // check if the source codepoint is unassigned if(val.type == UNASSIGNED && allowUnassigned == false){ throw new ParseException("An unassigned code point was found in the input " + iter.getText(), iter.getIndex()); }else if((val.type == MAP)){ int index, length; if(val.isIndex){ index = val.value; if(index >= indexes[ONE_UCHAR_MAPPING_INDEX_START] && index < indexes[TWO_UCHARS_MAPPING_INDEX_START]){ length = 1; }else if(index >= indexes[TWO_UCHARS_MAPPING_INDEX_START] && index < indexes[THREE_UCHARS_MAPPING_INDEX_START]){ length = 2; }else if(index >= indexes[THREE_UCHARS_MAPPING_INDEX_START] && index < indexes[FOUR_UCHARS_MAPPING_INDEX_START]){ length = 3; }else{ length = mappingData[index++]; } /* copy mapping to destination */ dest.append(mappingData,index,length); continue; }else{ ch -= val.value; } }else if(val.type == DELETE){ // just consume the codepoint and contine continue; } //copy the source into destination UTF16.append(dest,ch); } return dest; }
Example #12
Source File: StringPrep.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
private StringBuffer map( UCharacterIterator iter, int options) throws ParseException { Values val = new Values(); char result = 0; int ch = UCharacterIterator.DONE; StringBuffer dest = new StringBuffer(); boolean allowUnassigned = ((options & ALLOW_UNASSIGNED)>0); while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){ result = getCodePointValue(ch); getValues(result,val); // check if the source codepoint is unassigned if(val.type == UNASSIGNED && allowUnassigned == false){ throw new ParseException("An unassigned code point was found in the input " + iter.getText(), iter.getIndex()); }else if((val.type == MAP)){ int index, length; if(val.isIndex){ index = val.value; if(index >= indexes[ONE_UCHAR_MAPPING_INDEX_START] && index < indexes[TWO_UCHARS_MAPPING_INDEX_START]){ length = 1; }else if(index >= indexes[TWO_UCHARS_MAPPING_INDEX_START] && index < indexes[THREE_UCHARS_MAPPING_INDEX_START]){ length = 2; }else if(index >= indexes[THREE_UCHARS_MAPPING_INDEX_START] && index < indexes[FOUR_UCHARS_MAPPING_INDEX_START]){ length = 3; }else{ length = mappingData[index++]; } /* copy mapping to destination */ dest.append(mappingData,index,length); continue; }else{ ch -= val.value; } }else if(val.type == DELETE){ // just consume the codepoint and contine continue; } //copy the source into destination UTF16.append(dest,ch); } return dest; }
Example #13
Source File: StringPrep.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
private StringBuffer map( UCharacterIterator iter, int options) throws ParseException { Values val = new Values(); char result = 0; int ch = UCharacterIterator.DONE; StringBuffer dest = new StringBuffer(); boolean allowUnassigned = ((options & ALLOW_UNASSIGNED)>0); while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){ result = getCodePointValue(ch); getValues(result,val); // check if the source codepoint is unassigned if(val.type == UNASSIGNED && allowUnassigned == false){ throw new ParseException("An unassigned code point was found in the input " + iter.getText(), iter.getIndex()); }else if((val.type == MAP)){ int index, length; if(val.isIndex){ index = val.value; if(index >= indexes[ONE_UCHAR_MAPPING_INDEX_START] && index < indexes[TWO_UCHARS_MAPPING_INDEX_START]){ length = 1; }else if(index >= indexes[TWO_UCHARS_MAPPING_INDEX_START] && index < indexes[THREE_UCHARS_MAPPING_INDEX_START]){ length = 2; }else if(index >= indexes[THREE_UCHARS_MAPPING_INDEX_START] && index < indexes[FOUR_UCHARS_MAPPING_INDEX_START]){ length = 3; }else{ length = mappingData[index++]; } /* copy mapping to destination */ dest.append(mappingData,index,length); continue; }else{ ch -= val.value; } }else if(val.type == DELETE){ // just consume the codepoint and contine continue; } //copy the source into destination UTF16.append(dest,ch); } return dest; }
Example #14
Source File: StringPrep.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
private StringBuffer map( UCharacterIterator iter, int options) throws ParseException { Values val = new Values(); char result = 0; int ch = UCharacterIterator.DONE; StringBuffer dest = new StringBuffer(); boolean allowUnassigned = ((options & ALLOW_UNASSIGNED)>0); while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){ result = getCodePointValue(ch); getValues(result,val); // check if the source codepoint is unassigned if(val.type == UNASSIGNED && allowUnassigned == false){ throw new ParseException("An unassigned code point was found in the input " + iter.getText(), iter.getIndex()); }else if((val.type == MAP)){ int index, length; if(val.isIndex){ index = val.value; if(index >= indexes[ONE_UCHAR_MAPPING_INDEX_START] && index < indexes[TWO_UCHARS_MAPPING_INDEX_START]){ length = 1; }else if(index >= indexes[TWO_UCHARS_MAPPING_INDEX_START] && index < indexes[THREE_UCHARS_MAPPING_INDEX_START]){ length = 2; }else if(index >= indexes[THREE_UCHARS_MAPPING_INDEX_START] && index < indexes[FOUR_UCHARS_MAPPING_INDEX_START]){ length = 3; }else{ length = mappingData[index++]; } /* copy mapping to destination */ dest.append(mappingData,index,length); continue; }else{ ch -= val.value; } }else if(val.type == DELETE){ // just consume the codepoint and contine continue; } //copy the source into destination UTF16.append(dest,ch); } return dest; }