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

How to use
RuleBasedCollatorICU
in
libcore.icu

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

origin: robovm/robovm

/**
 * Constructs a new {@code Collator} instance.
 */
protected Collator() {
  icuColl = new RuleBasedCollatorICU(Locale.getDefault());
}
origin: robovm/robovm

public CollationElementIteratorICU getCollationElementIterator(CharacterIterator it) {
  // We only implement the String-based API, so build a string from the iterator.
  return getCollationElementIterator(characterIteratorToString(it));
}
origin: robovm/robovm

/**
 * Returns a new collator with the same decomposition mode and
 * strength value as this collator.
 *
 * @return a shallow copy of this collator.
 * @see java.lang.Cloneable
 */
@Override
public Object clone() {
  try {
    Collator clone = (Collator) super.clone();
    clone.icuColl = (RuleBasedCollatorICU) icuColl.clone();
    return clone;
  } catch (CloneNotSupportedException e) {
    throw new AssertionError(e);
  }
}
origin: robovm/robovm

@Override public boolean equals(Object object) {
  if (object ==  this) {
    return true;
  }
  if (!(object instanceof RuleBasedCollatorICU)) {
    return false;
  }
  RuleBasedCollatorICU rhs = (RuleBasedCollatorICU) object;
  return getRules().equals(rhs.getRules()) &&
      getStrength() == rhs.getStrength() &&
      getDecomposition() == rhs.getDecomposition();
}
origin: robovm/robovm

public boolean equals(String source, String target) {
  return (compare(source, target) == 0);
}
origin: robovm/robovm

/**
 * Obtains a {@code CollationElementIterator} for the given string.
 *
 * @param source
 *            the source string.
 * @return the {@code CollationElementIterator} for {@code source}.
 */
public CollationElementIterator getCollationElementIterator(String source) {
  if (source == null) {
    throw new NullPointerException("source == null");
  }
  return new CollationElementIterator(icuColl.getCollationElementIterator(source));
}
origin: robovm/robovm

/**
 * Returns the collation rules of this collator. These {@code rules} can be
 * fed into the {@code RuleBasedCollator(String)} constructor.
 * <p>
 * Note that the {@code rules} are actually interpreted as a delta to the
 * standard Unicode Collation Algorithm (UCA). Hence, an empty {@code rules}
 * string results in the default UCA rules being applied. This differs
 * slightly from other implementations which work with full {@code rules}
 * specifications and may result in different behavior.
 *
 * @return the collation rules.
 */
public String getRules() {
  return icuColl.getRules();
}
origin: robovm/robovm

/**
 * Returns the decomposition rule for this collator.
 *
 * @return the decomposition rule, either {@code NO_DECOMPOSITION} or
 *         {@code CANONICAL_DECOMPOSITION}. {@code FULL_DECOMPOSITION} is
 *         not supported.
 */
public int getDecomposition() {
  return decompositionMode_ICU_Java(icuColl.getDecomposition());
}
origin: robovm/robovm

/**
 * Returns the strength value for this collator.
 *
 * @return the strength value, either PRIMARY, SECONDARY, TERTIARY or
 *         IDENTICAL.
 */
public int getStrength() {
  return strength_ICU_Java(icuColl.getStrength());
}
origin: robovm/robovm

/**
 * Returns the {@code CollationKey} for the given source text.
 *
 * @param source
 *            the specified source text.
 * @return the {@code CollationKey} for the given source text.
 */
@Override
public CollationKey getCollationKey(String source) {
  return icuColl.getCollationKey(source);
}
origin: robovm/robovm

/**
 * Compares this collator with the specified object and indicates if they
 * are equal.
 *
 * @param object
 *            the object to compare with this object.
 * @return {@code true} if {@code object} is a {@code Collator} object and
 *         it has the same strength and decomposition values as this
 *         collator; {@code false} otherwise.
 * @see #hashCode
 */
@Override
public boolean equals(Object object) {
  if (!(object instanceof Collator)) {
    return false;
  }
  Collator collator = (Collator) object;
  return icuColl == null ? collator.icuColl == null : icuColl.equals(collator.icuColl);
}
origin: MobiVM/robovm

@Override public boolean equals(Object object) {
  if (object ==  this) {
    return true;
  }
  if (!(object instanceof RuleBasedCollatorICU)) {
    return false;
  }
  RuleBasedCollatorICU rhs = (RuleBasedCollatorICU) object;
  return getRules().equals(rhs.getRules()) &&
      getStrength() == rhs.getStrength() &&
      getDecomposition() == rhs.getDecomposition();
}
origin: robovm/robovm

/**
 * Compares the {@code source} text to the {@code target} text according to
 * the collation rules, strength and decomposition mode for this
 * {@code RuleBasedCollator}. See the {@code Collator} class description
 * for an example of use.
 * <p>
 * General recommendation: If comparisons are to be done with the same strings
 * multiple times, it is more efficient to generate {@code CollationKey}
 * objects for the strings and use
 * {@code CollationKey.compareTo(CollationKey)} for the comparisons. If each
 * string is compared to only once, using
 * {@code RuleBasedCollator.compare(String, String)} has better performance.
 *
 * @param source
 *            the source text.
 * @param target
 *            the target text.
 * @return an integer which may be a negative value, zero, or else a
 *         positive value depending on whether {@code source} is less than,
 *         equivalent to, or greater than {@code target}.
 */
@Override
public int compare(String source, String target) {
  if (source == null) {
    throw new NullPointerException("source == null");
  } else if (target == null) {
    throw new NullPointerException("target == null");
  }
  return icuColl.compare(source, target);
}
origin: robovm/robovm

/**
 * Obtains a {@code CollationElementIterator} for the given
 * {@code CharacterIterator}. The source iterator's integrity will be
 * preserved since a new copy will be created for use.
 *
 * @param source
 *            the source character iterator.
 * @return a {@code CollationElementIterator} for {@code source}.
 */
public CollationElementIterator getCollationElementIterator(CharacterIterator source) {
  if (source == null) {
    throw new NullPointerException("source == null");
  }
  return new CollationElementIterator(icuColl.getCollationElementIterator(source));
}
origin: robovm/robovm

@Override
public int hashCode() {
  return icuColl.getRules().hashCode();
}
origin: com.gluonhq/robovm-rt

/**
 * Returns the decomposition rule for this collator.
 *
 * @return the decomposition rule, either {@code NO_DECOMPOSITION} or
 *         {@code CANONICAL_DECOMPOSITION}. {@code FULL_DECOMPOSITION} is
 *         not supported.
 */
public int getDecomposition() {
  return decompositionMode_ICU_Java(icuColl.getDecomposition());
}
origin: MobiVM/robovm

/**
 * Returns the strength value for this collator.
 *
 * @return the strength value, either PRIMARY, SECONDARY, TERTIARY or
 *         IDENTICAL.
 */
public int getStrength() {
  return strength_ICU_Java(icuColl.getStrength());
}
origin: MobiVM/robovm

/**
 * Returns the {@code CollationKey} for the given source text.
 *
 * @param source
 *            the specified source text.
 * @return the {@code CollationKey} for the given source text.
 */
@Override
public CollationKey getCollationKey(String source) {
  return icuColl.getCollationKey(source);
}
origin: com.gluonhq/robovm-rt

/**
 * Compares this collator with the specified object and indicates if they
 * are equal.
 *
 * @param object
 *            the object to compare with this object.
 * @return {@code true} if {@code object} is a {@code Collator} object and
 *         it has the same strength and decomposition values as this
 *         collator; {@code false} otherwise.
 * @see #hashCode
 */
@Override
public boolean equals(Object object) {
  if (!(object instanceof Collator)) {
    return false;
  }
  Collator collator = (Collator) object;
  return icuColl == null ? collator.icuColl == null : icuColl.equals(collator.icuColl);
}
origin: com.mobidevelop.robovm/robovm-rt

@Override public boolean equals(Object object) {
  if (object ==  this) {
    return true;
  }
  if (!(object instanceof RuleBasedCollatorICU)) {
    return false;
  }
  RuleBasedCollatorICU rhs = (RuleBasedCollatorICU) object;
  return getRules().equals(rhs.getRules()) &&
      getStrength() == rhs.getStrength() &&
      getDecomposition() == rhs.getDecomposition();
}
libcore.icuRuleBasedCollatorICU

Most used methods

  • <init>
  • characterIteratorToString
  • clone
  • compare
  • equals
  • getCollationElementIterator
  • getCollationKey
  • getDecomposition
  • getRules
  • getStrength
  • setDecomposition
  • setStrength
  • setDecomposition,
  • setStrength

Popular in Java

  • Parsing JSON documents to java classes using gson
  • compareTo (BigDecimal)
  • getSharedPreferences (Context)
  • runOnUiThread (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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