protected void adjustTypeNames(Map typeNameMap) { adjustReturnType(typeNameMap); adjustExceptions(typeNameMap); adjustLines(typeNameMap); }
private void adjustLines(Map typeNameMap) { for (Iterator i = new Vector(getLines()).iterator(); i.hasNext();) { adjustLine((String)i.next(), typeNameMap); } }
private void adjustExceptions(Map typeNameMap) { for (Iterator i = new Vector(getExceptions()).iterator(); i.hasNext();) { String exceptionName = (String)i.next(); String adjustedExceptionName = adjustTypeName(exceptionName, typeNameMap); if (!exceptionName.equals(adjustedExceptionName)) { replaceException(exceptionName, adjustedExceptionName); } } }
private void adjustReturnType(Map typeNameMap) { String adjustedReturnType = adjustTypeName(getReturnType(), typeNameMap); if (!getReturnType().equals(adjustedReturnType)) { setReturnType(adjustedReturnType); } }
public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof MethodDefinition)) { return false; } MethodDefinition methodDefinition = (MethodDefinition)object; if ((this.name == null) && (methodDefinition.getName() != null)) { return false; } if ((this.name != null) && !this.name.equals(methodDefinition.getName())) { return false; } if (!this.accessLevel.equals(methodDefinition.getAccessLevel())) { return false; } if (!this.returnType.equals(methodDefinition.getReturnType())) { return false; } if (!argumentsEqual(methodDefinition)) { return false; } if (!exceptionsEqual(methodDefinition)) { return false; } return true; }
/** * Parses the line, removing the package name for each type * (and adding the appropriate import) if the type is * unambiguous. */ private void adjustLine(String line, Map typeNameMap) { StringBuffer lineInProgress = new StringBuffer(line); Set typeNames = parseForTypeNames(lineInProgress.toString()); for (Iterator i = typeNames.iterator(); i.hasNext();) { String typeName = (String)i.next(); String adjustedTypeName = adjustTypeName(typeName, typeNameMap); if (!typeName.equals(adjustedTypeName)) { int typeNameStartIndex = lineInProgress.toString().indexOf(typeName); while (typeNameStartIndex != -1) { lineInProgress.replace(typeNameStartIndex, typeNameStartIndex + typeName.length(), adjustedTypeName); typeNameStartIndex = lineInProgress.toString().indexOf(typeName); } } } replaceLine(line, lineInProgress.toString()); }
public Iterator argumentNames() { return getArgumentNames().iterator(); }
protected void adjustTypeNames(Map typeNameMap) { super.adjustTypeNames(typeNameMap); adjustArgumentTypeNames(typeNameMap); }
public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof MethodDefinition)) { return false; } MethodDefinition methodDefinition = (MethodDefinition)object; if ((this.name == null) && (methodDefinition.getName() != null)) { return false; } if ((this.name != null) && !this.name.equals(methodDefinition.getName())) { return false; } if (!this.accessLevel.equals(methodDefinition.getAccessLevel())) { return false; } if (!this.returnType.equals(methodDefinition.getReturnType())) { return false; } if (!argumentsEqual(methodDefinition)) { return false; } if (!exceptionsEqual(methodDefinition)) { return false; } return true; }
private void adjustReturnType(Map typeNameMap) { String adjustedReturnType = adjustTypeName(getReturnType(), typeNameMap); if (!getReturnType().equals(adjustedReturnType)) { setReturnType(adjustedReturnType); } }
/** * Parses the line, removing the package name for each type * (and adding the appropriate import) if the type is * unambiguous. */ private void adjustLine(String line, Map typeNameMap) { StringBuffer lineInProgress = new StringBuffer(line); Set typeNames = parseForTypeNames(lineInProgress.toString()); for (Iterator i = typeNames.iterator(); i.hasNext();) { String typeName = (String)i.next(); String adjustedTypeName = adjustTypeName(typeName, typeNameMap); if (!typeName.equals(adjustedTypeName)) { int typeNameStartIndex = lineInProgress.toString().indexOf(typeName); while (typeNameStartIndex != -1) { lineInProgress.replace(typeNameStartIndex, typeNameStartIndex + typeName.length(), adjustedTypeName); typeNameStartIndex = lineInProgress.toString().indexOf(typeName); } } } replaceLine(line, lineInProgress.toString()); }
public String getArgumentName(int index) { return (String)getArgumentNames().get(index); }
protected void adjustTypeNames(Map typeNameMap) { super.adjustTypeNames(typeNameMap); adjustArgumentTypeNames(typeNameMap); }
public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof MethodDefinition)) { return false; } MethodDefinition methodDefinition = (MethodDefinition)object; if ((this.name == null) && (methodDefinition.getName() != null)) { return false; } if ((this.name != null) && !this.name.equals(methodDefinition.getName())) { return false; } if (!this.accessLevel.equals(methodDefinition.getAccessLevel())) { return false; } if (!this.returnType.equals(methodDefinition.getReturnType())) { return false; } if (!argumentsEqual(methodDefinition)) { return false; } if (!exceptionsEqual(methodDefinition)) { return false; } return true; }
protected void adjustTypeNames(Map typeNameMap) { adjustReturnType(typeNameMap); adjustExceptions(typeNameMap); adjustLines(typeNameMap); }
private void adjustExceptions(Map typeNameMap) { for (Iterator i = new Vector(getExceptions()).iterator(); i.hasNext();) { String exceptionName = (String)i.next(); String adjustedExceptionName = adjustTypeName(exceptionName, typeNameMap); if (!exceptionName.equals(adjustedExceptionName)) { replaceException(exceptionName, adjustedExceptionName); } } }
private void adjustReturnType(Map typeNameMap) { String adjustedReturnType = adjustTypeName(getReturnType(), typeNameMap); if (!getReturnType().equals(adjustedReturnType)) { setReturnType(adjustedReturnType); } }
/** * Parses the line, removing the package name for each type * (and adding the appropriate import) if the type is * unambiguous. */ private void adjustLine(String line, Map typeNameMap) { StringBuffer lineInProgress = new StringBuffer(line); Set typeNames = parseForTypeNames(lineInProgress.toString()); for (Iterator i = typeNames.iterator(); i.hasNext();) { String typeName = (String)i.next(); String adjustedTypeName = adjustTypeName(typeName, typeNameMap); if (!typeName.equals(adjustedTypeName)) { int typeNameStartIndex = lineInProgress.toString().indexOf(typeName); while (typeNameStartIndex != -1) { lineInProgress.replace(typeNameStartIndex, typeNameStartIndex + typeName.length(), adjustedTypeName); typeNameStartIndex = lineInProgress.toString().indexOf(typeName); } } } replaceLine(line, lineInProgress.toString()); }
private void adjustLines(Map typeNameMap) { for (Iterator i = new Vector(getLines()).iterator(); i.hasNext();) { adjustLine((String)i.next(), typeNameMap); } }
public String getArgumentName(int index) { return (String)getArgumentNames().get(index); }