1 19 package org.netbeans.modules.javacore.parser; 20 21 import org.netbeans.jmi.javamodel.EnumConstant; 22 23 27 public class EnumConstInfoMeasure implements Measure { 28 static final EnumConstInfoMeasure INSTANCE = new EnumConstInfoMeasure(); 29 30 private EnumConstInfoMeasure() { 31 } 32 33 public int getDistance(Object refObject, Object ast) { 34 if (ast instanceof FeatureInfo) { 35 ElementInfo astInfo = (ElementInfo) ast; 36 EnumConstant refInfo = (EnumConstant) refObject; 37 38 if (astInfo.infoType==FeatureInfo.ENUM_CONSTANT_TYPE) { 39 return StringMeasure.INSTANCE.getDistance(refInfo.getName(),astInfo.name); 40 } 41 } 42 return INFINITE_DISTANCE; 43 } 44 } 45 | Popular Tags |