当前位置: 首页>>代码示例>>Java>>正文


Java Collator.clone方法代码示例

本文整理汇总了Java中com.ibm.icu.text.Collator.clone方法的典型用法代码示例。如果您正苦于以下问题:Java Collator.clone方法的具体用法?Java Collator.clone怎么用?Java Collator.clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ibm.icu.text.Collator的用法示例。


在下文中一共展示了Collator.clone方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ICUCollationKeyFilter

import com.ibm.icu.text.Collator; //导入方法依赖的package包/类
/**
 *
 * @param input Source token stream
 * @param collator CollationKey generator
 */
public ICUCollationKeyFilter(TokenStream input, Collator collator) {
  super(input);
  // clone the collator: see http://userguide.icu-project.org/collation/architecture
  try {
    this.collator = (Collator) collator.clone();
  } catch (CloneNotSupportedException e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:ICUCollationKeyFilter.java

示例2: setCollator

import com.ibm.icu.text.Collator; //导入方法依赖的package包/类
/**
 * Explicitly set the collator for this object.
 * @param collator The collator object to be passed.
 * @return this, for chaining
 * @draft ICU 3.6
 * @provisional This API might change or be removed in a future release.
 */
public GlobalizationPreferences setCollator(Collator collator) {
    if (isFrozen()) {
        throw new UnsupportedOperationException("Attempt to modify immutable object");
    }
    try {
        this.collator = (Collator) collator.clone(); // clone for safety
    } catch (CloneNotSupportedException e) {
            throw new ICUCloneNotSupportedException("Error in cloning collator", e);
    }
    return this;
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:19,代码来源:GlobalizationPreferences.java

示例3: ICUCollatedTermAttributeImpl

import com.ibm.icu.text.Collator; //导入方法依赖的package包/类
/**
 * Create a new ICUCollatedTermAttributeImpl
 * @param collator Collation key generator
 */
public ICUCollatedTermAttributeImpl(Collator collator) {
  // clone the collator: see http://userguide.icu-project.org/collation/architecture
  try {
    this.collator = (Collator) collator.clone();
  } catch (CloneNotSupportedException e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:13,代码来源:ICUCollatedTermAttributeImpl.java

示例4: ICUCollationDocValuesField

import com.ibm.icu.text.Collator; //导入方法依赖的package包/类
/**
 * 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 ICUCollationDocValuesField(String name, Collator collator) {
  super(name, SortedDocValuesField.TYPE);
  this.name = name;
  try {
    this.collator = (Collator) collator.clone();
  } catch (CloneNotSupportedException e) {
    throw new RuntimeException(e);
  }
  fieldsData = bytes; // so wrong setters cannot be called
}
 
开发者ID:europeana,项目名称:search,代码行数:22,代码来源:ICUCollationDocValuesField.java

示例5: ICUCollationKeyFilter

import com.ibm.icu.text.Collator; //导入方法依赖的package包/类
/**
 * 
 * @param input Source token stream
 * @param collator CollationKey generator
 */
public ICUCollationKeyFilter(TokenStream input, Collator collator) {
  super(input);
  // clone the collator: see http://userguide.icu-project.org/collation/architecture
  try {
    this.collator = (Collator) collator.clone();
  } catch (CloneNotSupportedException e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:15,代码来源:ICUCollationKeyFilter.java

示例6: IcuCollatedTermAttributeImpl

import com.ibm.icu.text.Collator; //导入方法依赖的package包/类
/**
 * Create a new ICU c ollated term attribute implementation.
 * @param collator Collation key generator
 */
IcuCollatedTermAttributeImpl(Collator collator) {
    // clone the collator: see http://userguide.icu-project.org/collation/architecture
    try {
        this.collator = (Collator) collator.clone();
    } catch (CloneNotSupportedException e) {
        throw new UnsupportedOperationException(e);
    }
}
 
开发者ID:jprante,项目名称:elasticsearch-plugin-bundle,代码行数:13,代码来源:IcuCollationAttributeFactory.java

示例7: makeCheck

import com.ibm.icu.text.Collator; //导入方法依赖的package包/类
@Override
protected void makeCheck(Placeholder target, ImmutableList<String> tokenizedInput, ULocale locale,
    String message) {
  if (tokenizedInput.size() < 2) {
    // Test passed. Nothing to sort.
    return;
  }

  int strength = Collator.SECONDARY;
  if (!target.isLenient()) {
    if (!target.isStrict()) {
      strength = Collator.TERTIARY;
    } else {
      strength = Collator.IDENTICAL;
    }
  }
  // Init collators.
  Collator collator = Collator.getInstance(locale);
  ImmutableList.Builder<Collator> collators = ImmutableList.builder();
  collators.add(collator);
  try {
    Collator collator2 = (RuleBasedCollator) collator.clone();
    collator2.setStrength(strength);
    collators.add(collator2);
    RuleBasedCollator collator3 = (RuleBasedCollator) collator.clone();
    collator3.setStrength(strength);
    collator3.setAlternateHandlingShifted(true);
    collators.add(collator3);
    RuleBasedCollator collator4 = (RuleBasedCollator) collator.clone();
    collator4.setStrength(strength);
    collator4.setNumericCollation(true);
    collators.add(collator4);
    RuleBasedCollator collator5 = (RuleBasedCollator) collator.clone();
    collator5.setStrength(strength);
    collator5.setAlternateHandlingShifted(true);
    collator5.setNumericCollation(true);
    collators.add(collator5);
  } catch (CloneNotSupportedException e) {
    // Do nothing.
  }
  makeCheck(collators.build(), tokenizedInput, locale, message);
}
 
开发者ID:googlei18n,项目名称:i18n_sanitycheck,代码行数:43,代码来源:OrderingChecker.java


注:本文中的com.ibm.icu.text.Collator.clone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。