Homework 3
This commit is contained in:
parent
bf60a078d7
commit
0afc86ceeb
129 changed files with 3163 additions and 4316 deletions
|
@ -1,34 +0,0 @@
|
|||
package cd.util.debug;
|
||||
|
||||
import static java.util.Collections.sort;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import cd.ir.Ast.ClassDecl;
|
||||
import cd.ir.Ast.MethodDecl;
|
||||
|
||||
class DumpUtils {
|
||||
|
||||
static final Comparator<ClassDecl> classComparator = new Comparator<ClassDecl>() {
|
||||
public int compare(ClassDecl left, ClassDecl right) {
|
||||
return left.name.compareTo(right.name);
|
||||
}
|
||||
};
|
||||
|
||||
static final Comparator<MethodDecl> methodComparator = new Comparator<MethodDecl>() {
|
||||
public int compare(MethodDecl left, MethodDecl right) {
|
||||
return left.name.compareTo(right.name);
|
||||
}
|
||||
};
|
||||
|
||||
static List<String> sortedStrings(Set<?> set) {
|
||||
List<String> strings = new ArrayList<String>();
|
||||
for(Object element : set)
|
||||
strings.add(element.toString());
|
||||
sort(strings);
|
||||
return strings;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue