本文整理汇总了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);
}