1 12 package org.eclipse.jdt.internal.corext.callhierarchy; 13 14 import java.util.ArrayList ; 15 import java.util.Collection ; 16 import java.util.List ; 17 18 import org.eclipse.jdt.core.IMember; 19 20 public class MethodCall { 21 private IMember fMember; 22 private List fCallLocations; 23 24 27 public MethodCall(IMember enclosingElement) { 28 this.fMember = enclosingElement; 29 } 30 31 34 public Collection getCallLocations() { 35 return fCallLocations; 36 } 37 38 public CallLocation getFirstCallLocation() { 39 if ((fCallLocations != null) && !fCallLocations.isEmpty()) { 40 return (CallLocation) fCallLocations.get(0); 41 } else { 42 return null; 43 } 44 } 45 46 public boolean hasCallLocations() { 47 return fCallLocations != null && fCallLocations.size() > 0; 48 } 49 50 53 public Object getKey() { 54 return getMember().getHandleIdentifier(); 55 } 56 57 60 public IMember getMember() { 61 return fMember; 62 } 63 64 67 public void addCallLocation(CallLocation location) { 68 if (fCallLocations == null) { 69 fCallLocations = new ArrayList (); 70 } 71 72 fCallLocations.add(location); 73 } 74 } 75 | Popular Tags |