Codota Logo
RuleBasedCollatorICU
Code IndexAdd Codota 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)

  • Common ways to obtain RuleBasedCollatorICU
private void myMethod () {
RuleBasedCollatorICU r =
  • Codota Iconnew RuleBasedCollatorICU(Locale.getDefault())
  • Codota IconString rules;new RuleBasedCollatorICU(rules)
  • Smart code suggestions by Codota
}
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

  • Making http post requests using okhttp
  • getContentResolver (Context)
  • getSupportFragmentManager (FragmentActivity)
  • startActivity (Activity)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • Reference (javax.naming)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now