本文整理匯總了Java中java.text.BreakIterator.getCharacterInstance方法的典型用法代碼示例。如果您正苦於以下問題:Java BreakIterator.getCharacterInstance方法的具體用法?Java BreakIterator.getCharacterInstance怎麽用?Java BreakIterator.getCharacterInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.text.BreakIterator
的用法示例。
在下文中一共展示了BreakIterator.getCharacterInstance方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: BreakIteratorTest
import java.text.BreakIterator; //導入方法依賴的package包/類
public BreakIteratorTest()
{
characterBreak = BreakIterator.getCharacterInstance();
wordBreak = BreakIterator.getWordInstance();
lineBreak = BreakIterator.getLineInstance();
sentenceBreak = BreakIterator.getSentenceInstance();
}
示例2: TestCharacterInvariants
import java.text.BreakIterator; //導入方法依賴的package包/類
public void TestCharacterInvariants()
{
BreakIterator e = BreakIterator.getCharacterInstance();
doBreakInvariantTest(e, cannedTestChars + "\u1100\u1101\u1102\u1160\u1161\u1162\u11a8"
+ "\u11a9\u11aa");
doOtherInvariantTest(e, cannedTestChars + "\u1100\u1101\u1102\u1160\u1161\u1162\u11a8"
+ "\u11a9\u11aa");
}
示例3: wrapStringToArray
import java.text.BreakIterator; //導入方法依賴的package包/類
/** Wrap multi-line strings (and get the individual lines).
* @param original the original string to wrap
* @param width the maximum width of lines
* @param wrapWords if <code>true</code>, the lines are wrapped on word boundaries (if possible);
* if <code>false</code>, character boundaries are used
* @param removeNewLines if <code>true</code>, any newlines in the original string are ignored
* @return the lines after wrapping
* @deprecated use {@link #wrapStringToArray(String, int, BreakIterator, boolean)} since it is better for I18N
*/
@Deprecated
public static String[] wrapStringToArray(String original, int width, boolean wrapWords, boolean removeNewLines) {
BreakIterator bi = (wrapWords ? BreakIterator.getWordInstance() : BreakIterator.getCharacterInstance());
return wrapStringToArray(original, width, bi, removeNewLines);
}