com.ibm.icu.text.Collator.getInstance()方法的使用及代码示例

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

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

Collator.getInstance介绍

[英]Returns the Collator for the current default locale. The default locale is determined by java.util.Locale.getDefault().
[中]返回当前默认区域设置的排序符。默认语言环境由java确定。util。场所getDefault()。

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

private String[] getHistoryEntries() {
  String[] history = selectionHistory
      .toArray(new String[selectionHistory.size()]);
  Arrays.sort(history, (o1, o2) -> Collator.getInstance().compare(o1, o2));
  return history;
}

代码示例来源:origin: org.elasticsearch.plugin/analysis-icu

@Override
  public TokenStream create(TokenStream tokenStream) {
    return new ICUCollationKeyFilter(tokenStream, Collator.getInstance());
  }
}));

代码示例来源:origin: org.eclipse/org.eclipse.ui.editors

public int compare(Object o1, Object o2) {
    if (!(o2 instanceof ListItem))
      return -1;
    if (!(o1 instanceof ListItem))
      return 1;
    String label1= ((ListItem)o1).label;
    String label2= ((ListItem)o2).label;
    return Collator.getInstance().compare(label1, label2);
  }
};

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

public CollationKey getDescriptionKey() {
  if (descriptionKey == null) {
    descriptionKey = Collator.getInstance()
        .getCollationKey(description);
  }
  return descriptionKey;
}

代码示例来源:origin: dita-ot/dita-ot

public static Integer compare(final String theS1, final String theS2, final String theLanguage, final String theCountry) {
  final Collator collator = Collator.getInstance(new Locale(theLanguage, theCountry));
  return new Integer(collator.compare(theS1, theS2));
}

代码示例来源:origin: org.eclipse/org.eclipse.ui.editors

public int compare(Object o1, Object o2) {
    if (!(o2 instanceof ListItem))
      return -1;
    if (!(o1 instanceof ListItem))
      return 1;
    String label1= ((ListItem)o1).name;
    String label2= ((ListItem)o2).name;
    return Collator.getInstance().compare(label1, label2);
  }
};

代码示例来源:origin: org.eclipse/org.eclipse.ui.editors

public int compareTo(Object o) {
    if (!(o instanceof NavigationEnablementAction))
      return -1;
    String otherName= ((NavigationEnablementAction)o).fName;
    return Collator.getInstance().compare(fName, otherName);
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

public DefaultJavaElementComparator(boolean doNotSortFields) {
  fDoNotSortFields= doNotSortFields;
  fCollator= Collator.getInstance();
  fMemberOrderCache= JavaPlugin.getDefault().getMemberOrderPreferenceCache();
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

public DefaultJavaElementComparator(boolean doNotSortFields) {
  fDoNotSortFields= doNotSortFields;
  fCollator= Collator.getInstance();
  fMemberOrderCache= JavaPlugin.getDefault().getMemberOrderPreferenceCache();
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

public DefaultJavaElementComparator(boolean doNotSortFields) {
  fDoNotSortFields= doNotSortFields;
  fCollator= Collator.getInstance();
  fMemberOrderCache= JavaPlugin.getDefault().getMemberOrderPreferenceCache();
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
  public int compare(CleanUpTabPageDescriptor o1, CleanUpTabPageDescriptor o2) {
    String name1= o1.getName();
    String name2= o2.getName();
    return Collator.getInstance().compare(name1.replaceAll("&", ""), name2.replaceAll("&", "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
  }
});

代码示例来源:origin: org.eclipse/org.eclipse.search

public int compare(Object o1, Object o2) {
    if (o1 instanceof IPerspectiveDescriptor && o2 instanceof IPerspectiveDescriptor) {
      String id1= ((IPerspectiveDescriptor)o1).getLabel();
      String id2= ((IPerspectiveDescriptor)o2).getLabel();
      return Collator.getInstance().compare(id1, id2);
    }
    return 0;
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
  public int compare(IJavaCompletionProposal p1, IJavaCompletionProposal p2) {
    return Collator.getInstance().compare(p1.getDisplayString(), p2.getDisplayString());
  }
});

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

public int compare(Viewer viewer, Object e1, Object e2) {
    IWorkingSet w1= (IWorkingSet)e1;
    IWorkingSet w2= (IWorkingSet)e2;
    return Collator.getInstance().compare(w1.getLabel(), w2.getLabel());
  }
};

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

public int compareTo(Object o) {
  if (o instanceof FilterDescriptor)
    return Collator.getInstance().compare(getName(), ((FilterDescriptor)o).getName());
  else
    return Integer.MIN_VALUE;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.search

@Override
  public int compare(IPerspectiveDescriptor o1, IPerspectiveDescriptor o2) {
    String id1= o1.getLabel();
    String id2= o2.getLabel();
    return Collator.getInstance().compare(id1, id2);
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.datatools.connectivity

public int compareTo(Object o) {
  if (o instanceof TemplateDescriptor)
    return Collator.getInstance().compare(getName(),
        ((TemplateDescriptor) o).getName());
  return Integer.MIN_VALUE;
}

代码示例来源:origin: org.eclipse/org.eclipse.datatools.connectivity

public int compareTo(Object o) {
  if (o instanceof CategoryDescriptor)
    return Collator.getInstance().compare(getName(),
        ((CategoryDescriptor) o).getName());
  return Integer.MIN_VALUE;
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

public int compare(Object o1, Object o2) {
    SaveParticipantDescriptor d1= (SaveParticipantDescriptor)o1;
    SaveParticipantDescriptor d2= (SaveParticipantDescriptor)o2;
    return Collator.getInstance().compare(d1.getPostSaveListener().getName(), d2.getPostSaveListener().getName());
  }
});

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
  public int compare(Viewer viewer, Object e1, Object e2) {
    GrayedCheckedModelElement w1= (GrayedCheckedModelElement)e1;
    GrayedCheckedModelElement w2= (GrayedCheckedModelElement)e2;
    return Collator.getInstance().compare(w1.getWorkingSet().getLabel(), w2.getWorkingSet().getLabel());
  }
}

相关文章