本文整理汇总了Java中com.owera.common.util.NaturalComparator类的典型用法代码示例。如果您正苦于以下问题:Java NaturalComparator类的具体用法?Java NaturalComparator怎么用?Java NaturalComparator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NaturalComparator类属于com.owera.common.util包,在下文中一共展示了NaturalComparator类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUnittypeParameterNamesShort
import com.owera.common.util.NaturalComparator; //导入依赖的package包/类
public Map<String, String> getUnittypeParameterNamesShort(Collection<UnittypeParameter> utParams) {
Map<String, String> resultMap = new TreeMap<String, String>(new NaturalComparator());
for (UnittypeParameter outerEntry : utParams) {
int counter = 0;
String[] utpNameArr = outerEntry.getName().split("\\.");
String utpNamePart = "";
for (int i = utpNameArr.length - 1; i >= 0; i--) {
counter = 0;
utpNamePart = "." + utpNameArr[i] + utpNamePart;
for (UnittypeParameter innerEntry : utParams) {
String utpName = "." + innerEntry.getName();
if (utpName.endsWith(utpNamePart))
counter++;
}
if (counter == 1) {
resultMap.put(outerEntry.getName(), utpNamePart.substring(1));
break;
}
}
}
return resultMap;
}
示例2: getStatus
import com.owera.common.util.NaturalComparator; //导入依赖的package包/类
public String getStatus() {
File dir = new File("tests");
String[] files = dir.list();
Arrays.sort(files, new NaturalComparator());
String[] finished = status.split(":");
Arrays.sort(finished, new NaturalComparator());
int match = 0;
for (int i = 0; i < finished.length; i++) {
for (int j = 0; j < files.length; j++) {
if (finished[i].equals(files[j]))
match++;
}
}
if (match == files.length - 2)
return "Completed (" + match + " of " + (files.length - 2) + ")";
else
return "Not completed (" + match + " of " + (files.length - 2) + ")";
}
示例3: getLastStep
import com.owera.common.util.NaturalComparator; //导入依赖的package包/类
public String getLastStep() {
if (status != null && status.length() > 0) {
String[] finished = status.split(":");
Arrays.sort(finished, new NaturalComparator());
return finished[finished.length - 1];
}
return "7.3.1.txt";
}
示例4: MapWrapper
import com.owera.common.util.NaturalComparator; //导入依赖的package包/类
public MapWrapper(boolean strictOrder) {
if (strictOrder)
map = new TreeMap<String, V>(new NaturalComparator());
else
map = new HashMap<String, V>();
}