use of org.vmmagic.unboxed.harness.WordComparator in project JikesRVM by JikesRVM.
the class HarnessOptionSet method parseWordSet.
private Word[] parseWordSet(String str) {
TreeSet<Word> values = new TreeSet<Word>(new WordComparator());
for (String element : str.split(",")) {
Long value;
if (element.startsWith("0x")) {
value = Long.valueOf(element.substring(2), 16);
} else {
value = Long.valueOf(element);
}
values.add(Word.fromLong(value));
}
Word[] result = new Word[values.size()];
for (int i = 0; i < result.length; i++) {
result[i] = values.pollFirst();
}
return result;
}
Aggregations