/** * Returns the unique 0-based position of the method within the class it was * declared in. */ public int getDeclarationPosition() { return DECLARATION_POSITION.get(getNd(), getAddress()); }
/** * Returns the unique 0-based position of the method within the class it was * declared in. */ public int getDeclarationPosition() { return DECLARATION_POSITION.get(getNd(), getAddress()); }
public NdMethodParameter createNewParameter() { return PARAMETERS.append(getNd(), getAddress()); }
public void setDeclarationPosition(int position) { DECLARATION_POSITION.put(getNd(), getAddress(), position); }
private NdMethodAnnotationData getAnnotationData() { return ANNOTATION_DATA.get(getNd(), getAddress()); }
public void setDeclarationPosition(int position) { DECLARATION_POSITION.put(getNd(), getAddress(), position); }
public void setMethodName(char[] selectorAndDescriptor) { METHOD_NAME.put(getNd(), getAddress(), selectorAndDescriptor); }
private NdMethodAnnotationData getAnnotationData() { return ANNOTATION_DATA.get(getNd(), getAddress()); }
public NdMethodParameter createNewParameter() { return PARAMETERS.append(getNd(), getAddress()); }
public void setMethodName(char[] selectorAndDescriptor) { METHOD_NAME.put(getNd(), getAddress(), selectorAndDescriptor); }
public NdMethodException createException(NdTypeSignature createTypeSignature) { NdMethodException result = EXCEPTIONS.append(getNd(), getAddress()); result.setExceptionType(createTypeSignature); return result; }
public NdMethodException createException(NdTypeSignature createTypeSignature) { NdMethodException result = EXCEPTIONS.append(getNd(), getAddress()); result.setExceptionType(createTypeSignature); return result; }
public char[] getSelector() { IString methodName = METHOD_NAME.get(getNd(), getAddress()); char[] methodNameString = methodName.getChars(); int bracketIndex = CharArrayUtils.indexOf('(', methodNameString); if (bracketIndex == -1) { bracketIndex = methodNameString.length; } return CharArrayUtils.subarray(methodNameString, 0, bracketIndex); }
public char[] getSelector() { IString methodName = METHOD_NAME.get(getNd(), getAddress()); char[] methodNameString = methodName.getChars(); int bracketIndex = CharArrayUtils.indexOf('(', methodNameString); if (bracketIndex == -1) { bracketIndex = methodNameString.length; } return CharArrayUtils.subarray(methodNameString, 0, bracketIndex); }
/** * Returns the list of methods, in declaration order. */ public List<NdMethod> getMethodsInDeclarationOrder() { List<NdMethod> unsorted = getMethods(); NdMethod[] sorted = new NdMethod[unsorted.size()]; for (NdMethod next : unsorted) { int pos = next.getDeclarationPosition(); if (pos < 0 || pos >= sorted.length) { throw getNd().describeProblem() .addProblemAddress(NdMethod.DECLARATION_POSITION, next.getAddress()) .build("Method " + next.getMethodName().getString() + " reports invalid position of " + pos); //$NON-NLS-1$//$NON-NLS-2$ } NdMethod oldMethodAtThisPosition = sorted[pos]; if (oldMethodAtThisPosition != null) { throw getNd().describeProblem() .addProblemAddress(NdMethod.DECLARATION_POSITION, next.getAddress()) .addProblemAddress(NdMethod.DECLARATION_POSITION, oldMethodAtThisPosition.getAddress()) .build("Method " + oldMethodAtThisPosition.getMethodName().getString() //$NON-NLS-1$ + " and method " + next.getMethodName().getString() + " both claim to be at position " //$NON-NLS-1$//$NON-NLS-2$ + pos); } sorted[pos] = next; } return Arrays.asList(sorted); }
/** * Returns the list of methods, in declaration order. */ public List<NdMethod> getMethodsInDeclarationOrder() { List<NdMethod> unsorted = getMethods(); NdMethod[] sorted = new NdMethod[unsorted.size()]; for (NdMethod next : unsorted) { int pos = next.getDeclarationPosition(); if (pos < 0 || pos >= sorted.length) { throw getNd().describeProblem() .addProblemAddress(NdMethod.DECLARATION_POSITION, next.getAddress()) .build("Method " + next.getMethodName().getString() + " reports invalid position of " + pos); //$NON-NLS-1$//$NON-NLS-2$ } NdMethod oldMethodAtThisPosition = sorted[pos]; if (oldMethodAtThisPosition != null) { throw getNd().describeProblem() .addProblemAddress(NdMethod.DECLARATION_POSITION, next.getAddress()) .addProblemAddress(NdMethod.DECLARATION_POSITION, oldMethodAtThisPosition.getAddress()) .build("Method " + oldMethodAtThisPosition.getMethodName().getString() //$NON-NLS-1$ + " and method " + next.getMethodName().getString() + " both claim to be at position " //$NON-NLS-1$//$NON-NLS-2$ + pos); } sorted[pos] = next; } return Arrays.asList(sorted); }