01: package org.incava.java;
02:
03: import java.util.*;
04: import net.sourceforge.pmd.ast.*;
05:
06: /**
07: * Miscellaneous routines for classs.
08: */
09: public class ClassUtil extends SimpleNodeUtil {
10: public static Token getName(ASTClassOrInterfaceDeclaration coid) {
11: return findToken(coid, JavaParserConstants.IDENTIFIER);
12: }
13:
14: public static double getMatchScore(
15: ASTClassOrInterfaceDeclaration a,
16: ASTClassOrInterfaceDeclaration b) {
17: return getName(a).image.equals(getName(b).image) ? 1.0 : 0.0;
18: }
19:
20: }
|