1 19 package org.netbeans.modules.javacore.parser; 20 21 import org.netbeans.modules.javacore.jmiimpl.javamodel.AttributeValueImpl; 22 23 27 class AnnotationValueInfoMeasure implements Measure { 28 public static final AnnotationValueInfoMeasure INSTANCE = new AnnotationValueInfoMeasure(); 29 30 31 private AnnotationValueInfoMeasure() { 32 } 33 34 39 public int getDistance(Object refObject, Object ast) { 40 if (ast instanceof AnnotationValueInfo) { 41 AnnotationValueInfo astInfo = (AnnotationValueInfo) ast; 42 AttributeValueImpl refInfo = (AttributeValueImpl) refObject; 43 44 return StringMeasure.INSTANCE.getDistance(refInfo.getName(),astInfo.name); 45 } 46 return INFINITE_DISTANCE; 47 } 48 } 49 | Popular Tags |