java.text.Collator.clone()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(162)

本文整理了Java中java.text.Collator.clone()方法的一些代码示例,展示了Collator.clone()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Collator.clone()方法的具体详情如下:
包路径:java.text.Collator
类名称:Collator
方法名:clone

Collator.clone介绍

[英]Returns a new collator with the same decomposition mode and strength value as this collator.
[中]返回与此折叠器具有相同分解模式和强度值的新折叠器。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Returns a new collator with the same collation rules, decomposition mode and
 * strength value as this collator.
 *
 * @return a shallow copy of this collator.
 * @see java.lang.Cloneable
 */
@Override
public Object clone() {
  RuleBasedCollator clone = (RuleBasedCollator) super.clone();
  return clone;
}

代码示例来源:origin: org.apache.lucene/lucene-analyzers-common

/**
 * Create a new CollatedTermAttributeImpl
 * @param collator Collation key generator
 */
public CollatedTermAttributeImpl(Collator collator) {
 // clone in case JRE doesn't properly sync,
 // or to reduce contention in case they do
 this.collator = (Collator) collator.clone();
}

代码示例来源:origin: org.apache.lucene/lucene-analyzers-common

/**
 * Create a new ICUCollationDocValuesField.
 * <p>
 * NOTE: you should not create a new one for each document, instead
 * just make one and reuse it during your indexing process, setting
 * the value via {@link #setStringValue(String)}.
 * @param name field name
 * @param collator Collator for generating collation keys.
 */
// TODO: can we make this trap-free? maybe just synchronize on the collator
// instead? 
public CollationDocValuesField(String name, Collator collator) {
 super(name, SortedDocValuesField.TYPE);
 this.name = name;
 this.collator = (Collator) collator.clone();
 fieldsData = bytes; // so wrong setters cannot be called
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

/**
 * Create a new CollatedTermAttributeImpl
 * @param collator Collation key generator
 */
public CollatedTermAttributeImpl(Collator collator) {
 // clone in case JRE doesn't properly sync,
 // or to reduce contention in case they do
 this.collator = (Collator) collator.clone();
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Returns a new collator with the same collation rules, decomposition mode and
 * strength value as this collator.
 *
 * @return a shallow copy of this collator.
 * @see java.lang.Cloneable
 */
@Override
public Object clone() {
  RuleBasedCollator clone = (RuleBasedCollator) super.clone();
  return clone;
}

代码示例来源:origin: harbby/presto-connectors

/**
 * Create a new CollatedTermAttributeImpl
 * @param collator Collation key generator
 */
public CollatedTermAttributeImpl(Collator collator) {
 // clone in case JRE doesn't properly sync,
 // or to reduce contention in case they do
 this.collator = (Collator) collator.clone();
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Returns a new collator with the same collation rules, decomposition mode and
 * strength value as this collator.
 *
 * @return a shallow copy of this collator.
 * @see java.lang.Cloneable
 */
@Override
public Object clone() {
  RuleBasedCollator clone = (RuleBasedCollator) super.clone();
  return clone;
}

代码示例来源:origin: com.salesforce.i18n/i18n-util

/**
 * @return a new comparator for strings for this LinguisticSort instance.
 */
@SuppressWarnings("unchecked")
// Converting from Comparator<Object> to Comparator<String>
public Comparator<String> getNonCachingComparator() {
  return (Comparator<String>)this.collator.clone();
}

代码示例来源:origin: MobiVM/robovm

/**
 * Returns a new collator with the same collation rules, decomposition mode and
 * strength value as this collator.
 *
 * @return a shallow copy of this collator.
 * @see java.lang.Cloneable
 */
@Override
public Object clone() {
  RuleBasedCollator clone = (RuleBasedCollator) super.clone();
  return clone;
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns a new collator with the same collation rules, decomposition mode and
 * strength value as this collator.
 *
 * @return a shallow copy of this collator.
 * @see java.lang.Cloneable
 */
@Override
public Object clone() {
  RuleBasedCollator clone = (RuleBasedCollator) super.clone();
  return clone;
}

代码示例来源:origin: com.salesforce.i18n/i18n-util

/**
 * @return a new collator for this LinguisticSort instance.
 */
public Collator getCollator() {
  // Since RuleBasedCollator.compare() is synchronized, it is not nice to return
  // this.collator here, because that would mean requests for the same language
  // will be waiting for each other.  Instead, return a clone.  And, cloning
  // RuleBasedCollator instances is much more efficient than creating one from
  // the rules.
  return (Collator)this.collator.clone();
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns a new collator with the same collation rules, decomposition mode and
 * strength value as this collator.
 *
 * @return a shallow copy of this collator.
 * @see java.lang.Cloneable
 */
@Override
public Object clone() {
  RuleBasedCollator clone = (RuleBasedCollator) super.clone();
  return clone;
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Returns a new collator with the same collation rules, decomposition mode and
 * strength value as this collator.
 *
 * @return a shallow copy of this collator.
 * @see java.lang.Cloneable
 */
@Override
public Object clone() {
  RuleBasedCollator clone = (RuleBasedCollator) super.clone();
  return clone;
}

代码示例来源:origin: harbby/presto-connectors

/**
 * Create a new ICUCollationDocValuesField.
 * <p>
 * NOTE: you should not create a new one for each document, instead
 * just make one and reuse it during your indexing process, setting
 * the value via {@link #setStringValue(String)}.
 * @param name field name
 * @param collator Collator for generating collation keys.
 */
// TODO: can we make this trap-free? maybe just synchronize on the collator
// instead? 
public CollationDocValuesField(String name, Collator collator) {
 super(name, SortedDocValuesField.TYPE);
 this.name = name;
 this.collator = (Collator) collator.clone();
 fieldsData = bytes; // so wrong setters cannot be called
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

/**
 * Create a new ICUCollationDocValuesField.
 * <p>
 * NOTE: you should not create a new one for each document, instead
 * just make one and reuse it during your indexing process, setting
 * the value via {@link #setStringValue(String)}.
 * @param name field name
 * @param collator Collator for generating collation keys.
 */
// TODO: can we make this trap-free? maybe just synchronize on the collator
// instead? 
public CollationDocValuesField(String name, Collator collator) {
 super(name, SortedDocValuesField.TYPE);
 this.name = name;
 this.collator = (Collator) collator.clone();
 fieldsData = bytes; // so wrong setters cannot be called
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.ibm.icu.base

/**
 * Clones the collator.
 * @stable ICU 2.6
 * @return a clone of this collator.
 */
public Object clone() throws CloneNotSupportedException {
  return new Collator((java.text.Collator)collator.clone());
}

代码示例来源:origin: at.bestsolution.eclipse/com.ibm.icu.base

/**
 * Clones the collator.
 * @stable ICU 2.6
 * @return a clone of this collator.
 */
public Object clone() throws CloneNotSupportedException {
  return new Collator((java.text.Collator)collator.clone());
}

代码示例来源:origin: INL/BlackLab

public Collators(Collator base, CollatorVersion version) {
  super();
  this.version = version;
  sensitive = (Collator)base.clone();
  sensitive.setStrength(Collator.TERTIARY);
  insensitive = getCollatorInsensitive((RuleBasedCollator)base.clone(), version);
}

代码示例来源:origin: com.ibm.icu/icu4j-localespi

@Override
public Object clone() {
  CollatorICU other = (CollatorICU)super.clone();
  try {
    other.fIcuCollator = (Collator)fIcuCollator.clone();
  } catch (CloneNotSupportedException e) {
    // ICU Collator clone() may throw CloneNotSupportedException,
    // but JDK does not.  We use UnsupportedOperationException instead
    // as workwround.
    throw new UnsupportedOperationException("clone() is not supported by this ICU Collator.");
  }
  return other;
}

代码示例来源:origin: com.salesforce.i18n/i18n-util

@Override
public Object clone() {
  return new ThaiPatchedCollator((Collator)this.originalCollator.clone());
}

相关文章