Tabnine Logo
CollationElementIteratorICU
Code IndexAdd Tabnine to your IDE (free)

How to use
CollationElementIteratorICU
in
libcore.icu

Best Java code snippets using libcore.icu.CollationElementIteratorICU (Showing top 20 results out of 315)

origin: robovm/robovm

public static CollationElementIteratorICU getInstance(long collatorAddress, String source) {
  long iteratorAddress = NativeCollation.getCollationElementIterator(collatorAddress, source);
  return new CollationElementIteratorICU(iteratorAddress);
}
origin: robovm/robovm

public CollationElementIteratorICU getCollationElementIterator(String source) {
  return CollationElementIteratorICU.getInstance(address, source);
}
origin: robovm/robovm

/**
 * Obtains the maximum length of any expansion sequence that ends with the
 * specified collation element. Returns {@code 1} if there is no expansion
 * with this collation element as the last element.
 *
 * @param order
 *            a collation element that has been previously obtained from a
 *            call to either the {@link #next()} or {@link #previous()}
 *            method.
 * @return the maximum length of any expansion sequence ending with the
 *         specified collation element.
 */
public int getMaxExpansion(int order) {
  return this.icuIterator.getMaxExpansion(order);
}
origin: robovm/robovm

/**
 * Obtains the primary order of the specified collation element, i.e. the
 * first 16 bits. This value is unsigned.
 *
 * @param order
 *            the element of the collation.
 * @return the element's 16 bit primary order.
 */
public static final int primaryOrder(int order) {
  return CollationElementIteratorICU.primaryOrder(order);
}
origin: robovm/robovm

/**
 * Obtains the secondary order of the specified collation element, i.e. the
 * 16th to 23th bits, inclusive. This value is unsigned.
 *
 * @param order
 *            the element of the collator.
 * @return the 8 bit secondary order of the element.
 */
public static final short secondaryOrder(int order) {
  return (short) CollationElementIteratorICU.secondaryOrder(order);
}
origin: robovm/robovm

/**
 * Obtains the next collation element in the source string.
 *
 * @return the next collation element or {@code NULLORDER} if the end
 *         of the iteration has been reached.
 */
public int next() {
  return this.icuIterator.next();
}
origin: robovm/robovm

/**
 * Repositions the cursor to point at the first element of the current
 * string. The next call to {@link #next()} or {@link #previous()} will
 * return the first and last collation element in the string, respectively.
 * <p>
 * If the {@code RuleBasedCollator} used by this iterator has had its
 * attributes changed, calling {@code reset()} reinitializes the iterator to
 * use the new attributes.
 */
public void reset() {
  this.icuIterator.reset();
}
origin: robovm/robovm

/**
 * Obtains the previous collation element in the source string.
 *
 * @return the previous collation element, or {@code NULLORDER} when
 *         the start of the iteration has been reached.
 */
public int previous() {
  return this.icuIterator.previous();
}
origin: robovm/robovm

/**
 * Points the iterator at the collation element associated with the
 * character in the source string which is found at the supplied offset.
 * After this call completes, an invocation of the {@link #next()} method
 * will return this collation element.
 * <p>
 * If {@code newOffset} corresponds to a character which is part of a
 * sequence that maps to a single collation element then the iterator is
 * adjusted to the start of that sequence. As a result of this, any
 * subsequent call made to {@code getOffset()} may not return the same value
 * set by this method.
 * <p>
 * If the decomposition mode is on, and offset is in the middle of a
 * decomposable range of source text, the iterator may not return a correct
 * result for the next forwards or backwards iteration. The user must ensure
 * that the offset is not in the middle of a decomposable range.
 *
 * @param newOffset
 *            the character offset into the original source string to set.
 *            Note that this is not an offset into the corresponding
 *            sequence of collation elements.
 */
public void setOffset(int newOffset) {
  this.icuIterator.setOffset(newOffset);
}
origin: robovm/robovm

/**
 * Obtains the character offset in the source string corresponding to the
 * next collation element. This value could be any of:
 * <ul>
 * <li>The index of the first character in the source string that matches
 * the value of the next collation element. This means that if
 * {@code setOffset(offset)} sets the index in the middle of a contraction,
 * {@code getOffset()} returns the index of the first character in the
 * contraction, which may not be equal to the original offset that was set.
 * Hence calling {@code getOffset()} immediately after
 * {@code setOffset(offset)} does not guarantee that the original offset set
 * will be returned.</li>
 * <li>If normalization is on, the index of the immediate subsequent
 * character, or composite character with the first character, having a
 * combining class of 0.</li>
 * <li>The length of the source string, if iteration has reached the end.
 * </li>
 * </ul>
 *
 * @return The position of the collation element in the source string that
 *         will be returned by the next invocation of the {@link #next()}
 *         method.
 */
public int getOffset() {
  return this.icuIterator.getOffset();
}
origin: MobiVM/robovm

/**
 * Obtains the primary order of the specified collation element, i.e. the
 * first 16 bits. This value is unsigned.
 *
 * @param order
 *            the element of the collation.
 * @return the element's 16 bit primary order.
 */
public static final int primaryOrder(int order) {
  return CollationElementIteratorICU.primaryOrder(order);
}
origin: ibinti/bugvm

/**
 * Obtains the secondary order of the specified collation element, i.e. the
 * 16th to 23th bits, inclusive. This value is unsigned.
 *
 * @param order
 *            the element of the collator.
 * @return the 8 bit secondary order of the element.
 */
public static final short secondaryOrder(int order) {
  return (short) CollationElementIteratorICU.secondaryOrder(order);
}
origin: MobiVM/robovm

/**
 * Obtains the next collation element in the source string.
 *
 * @return the next collation element or {@code NULLORDER} if the end
 *         of the iteration has been reached.
 */
public int next() {
  return this.icuIterator.next();
}
origin: MobiVM/robovm

/**
 * Repositions the cursor to point at the first element of the current
 * string. The next call to {@link #next()} or {@link #previous()} will
 * return the first and last collation element in the string, respectively.
 * <p>
 * If the {@code RuleBasedCollator} used by this iterator has had its
 * attributes changed, calling {@code reset()} reinitializes the iterator to
 * use the new attributes.
 */
public void reset() {
  this.icuIterator.reset();
}
origin: ibinti/bugvm

/**
 * Obtains the previous collation element in the source string.
 *
 * @return the previous collation element, or {@code NULLORDER} when
 *         the start of the iteration has been reached.
 */
public int previous() {
  return this.icuIterator.previous();
}
origin: MobiVM/robovm

/**
 * Points the iterator at the collation element associated with the
 * character in the source string which is found at the supplied offset.
 * After this call completes, an invocation of the {@link #next()} method
 * will return this collation element.
 * <p>
 * If {@code newOffset} corresponds to a character which is part of a
 * sequence that maps to a single collation element then the iterator is
 * adjusted to the start of that sequence. As a result of this, any
 * subsequent call made to {@code getOffset()} may not return the same value
 * set by this method.
 * <p>
 * If the decomposition mode is on, and offset is in the middle of a
 * decomposable range of source text, the iterator may not return a correct
 * result for the next forwards or backwards iteration. The user must ensure
 * that the offset is not in the middle of a decomposable range.
 *
 * @param newOffset
 *            the character offset into the original source string to set.
 *            Note that this is not an offset into the corresponding
 *            sequence of collation elements.
 */
public void setOffset(int newOffset) {
  this.icuIterator.setOffset(newOffset);
}
origin: ibinti/bugvm

/**
 * Obtains the character offset in the source string corresponding to the
 * next collation element. This value could be any of:
 * <ul>
 * <li>The index of the first character in the source string that matches
 * the value of the next collation element. This means that if
 * {@code setOffset(offset)} sets the index in the middle of a contraction,
 * {@code getOffset()} returns the index of the first character in the
 * contraction, which may not be equal to the original offset that was set.
 * Hence calling {@code getOffset()} immediately after
 * {@code setOffset(offset)} does not guarantee that the original offset set
 * will be returned.</li>
 * <li>If normalization is on, the index of the immediate subsequent
 * character, or composite character with the first character, having a
 * combining class of 0.</li>
 * <li>The length of the source string, if iteration has reached the end.
 * </li>
 * </ul>
 *
 * @return The position of the collation element in the source string that
 *         will be returned by the next invocation of the {@link #next()}
 *         method.
 */
public int getOffset() {
  return this.icuIterator.getOffset();
}
origin: ibinti/bugvm

/**
 * Obtains the primary order of the specified collation element, i.e. the
 * first 16 bits. This value is unsigned.
 *
 * @param order
 *            the element of the collation.
 * @return the element's 16 bit primary order.
 */
public static final int primaryOrder(int order) {
  return CollationElementIteratorICU.primaryOrder(order);
}
origin: com.bugvm/bugvm-rt

/**
 * Obtains the secondary order of the specified collation element, i.e. the
 * 16th to 23th bits, inclusive. This value is unsigned.
 *
 * @param order
 *            the element of the collator.
 * @return the 8 bit secondary order of the element.
 */
public static final short secondaryOrder(int order) {
  return (short) CollationElementIteratorICU.secondaryOrder(order);
}
origin: ibinti/bugvm

/**
 * Obtains the next collation element in the source string.
 *
 * @return the next collation element or {@code NULLORDER} if the end
 *         of the iteration has been reached.
 */
public int next() {
  return this.icuIterator.next();
}
libcore.icuCollationElementIteratorICU

Javadoc

Collation element iterator JNI wrapper. Iterates over the collation elements of a data string. The iterator supports both forward and backwards full iteration, ie if backwards iteration is performed in the midst of a forward iteration, the result is undefined. To perform a backwards iteration in the midst of a forward iteration, reset() has to be called. This will shift the position to either the start or the last character in the data string depending on whether next() is called or previous().
 
RuleBasedCollator coll = Collator.getInstance(); 
CollationElementIterator iterator = coll.getCollationElementIterator("abc"); 
int ce = 0; 
while (ce != CollationElementIterator.NULLORDER) { 
ce = iterator.next(); 
} 
iterator.reset(); 
while (ce != CollationElementIterator.NULLORDER) { 
ce = iterator.previous(); 
} 

Most used methods

  • <init>
  • getInstance
  • getMaxExpansion
    Get the maximum length of any expansion sequences that end with the specified comparison order.
  • getOffset
    Get the offset of the current source character. This is an offset into the text of the character con
  • next
    Get the ordering priority of the next collation element in the text. A single character may contain
  • previous
    Get the ordering priority of the previous collation element in the text. A single character may cont
  • primaryOrder
    Gets the primary order of a collation order.
  • reset
    Reset the collation elements to their initial state. This will move the 'cursor' to the beginning of
  • secondaryOrder
    Gets the secondary order of a collation order.
  • setOffset
    Set the offset of the current source character. This is an offset into the text of the character to
  • setText
  • tertiaryOrder
    Gets the tertiary order of a collation order.
  • setText,
  • tertiaryOrder

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (Timer)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Path (java.nio.file)
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now