Exemplo n.º 1
0
  /**
   * Return a new instance of BreakIterator used to iterate word-breaks using given locale.
   *
   * @param where the given locale
   * @return a new instance of BreakIterator used to iterate word-breaks using given locale.
   */
  public static BreakIterator getWordInstance(Locale where) {
    if (where == null) {
      throw new NullPointerException();
    }

    return new RuleBasedBreakIterator(com.ibm.icu4jni.text.BreakIterator.getWordInstance(where));
  }
Exemplo n.º 2
0
 /**
  * Create copy of this iterator, all status including current position is kept.
  *
  * @return copy of this iterator
  */
 @Override
 public Object clone() {
   try {
     BreakIterator cloned = (BreakIterator) super.clone();
     cloned.wrapped = (com.ibm.icu4jni.text.BreakIterator) wrapped.clone();
     return cloned;
   } catch (CloneNotSupportedException e) {
     throw new InternalError(e.getMessage());
   }
 }
Exemplo n.º 3
0
 /**
  * Set the new text string to be analyzed, the current position will be reset to beginning of this
  * new string, and the old string will lost.
  *
  * @param newText the new text string to be analyzed
  */
 public void setText(String newText) {
   wrapped.setText(newText);
 }
Exemplo n.º 4
0
 /**
  * Return the position of last boundary precede the given offset, and set current position to
  * returned value, or <code>DONE</code> if the given offset specifies the starting position.
  *
  * <p><code>IllegalArgumentException</code> will be thrown if given offset is invalid.
  *
  * @param offset the given start position to be searched for
  * @return the position of last boundary precede the given offset
  */
 public int preceding(int offset) {
   return wrapped.preceding(offset);
 }
Exemplo n.º 5
0
 /**
  * Return true if the given offset is a boundary position. If this method returns true, the
  * current iteration position is set to the given position; if the function returns false, the
  * current iteration position is set as though following() had been called.
  *
  * @param offset the given offset to check
  * @return true if the given offset is a boundary position
  */
 public boolean isBoundary(int offset) {
   return wrapped.isBoundary(offset);
 }
Exemplo n.º 6
0
 /**
  * Return a new instance of BreakIterator used to iterate word-breaks using default locale.
  *
  * @return a new instance of BreakIterator used to iterate word-breaks using default locale.
  */
 public static BreakIterator getWordInstance() {
   return new RuleBasedBreakIterator(com.ibm.icu4jni.text.BreakIterator.getWordInstance());
 }
Exemplo n.º 7
0
 /**
  * Return all supported locales.
  *
  * @return all supported locales
  */
 public static Locale[] getAvailableLocales() {
   return com.ibm.icu4jni.text.BreakIterator.getAvailableLocales();
 }