/** * Return a human readable representation of this translation path, used by the logging * methods to print trace information. */ @SuppressWarnings("unchecked") @Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append(getPathCost() + " "); if (sourceReference != null && initialBuilder != null) { sb.append(sourceReference.toString() + "->bytes(" + sourceReference.getResolutionCost() + ")->"); String builderClassName = initialBuilder.getClass().getSimpleName(); String builtType = initialBuilder.getReferenceType().getSimpleName(); sb.append("builder:" + builderClassName + "(" + initialBuilder.getConstructionCost() + "):<" + builtType + ">"); } else if (translators.isEmpty() == false) { sb.append("<" + translators.get(0).getSourceReferenceType().getSimpleName() + ">"); } for (ExternalReferenceTranslatorSPI translator : translators) { sb.append("-" + translator.getClass().getSimpleName() + "(" + translator.getTranslationCost() + ")" + "-"); sb.append("<" + translator.getTargetReferenceType().getSimpleName() + ">"); } return sb.toString(); }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append(getPathCost() + " "); if (sourceReference != null && initialBuilder != null) { sb.append(sourceReference.toString() + "->bytes("
public String toString() { StringBuffer sb = new StringBuffer(); sb.append(getPathCost() + " "); if (sourceReference != null && initialBuilder != null) { sb.append(sourceReference.toString() + "->bytes("
/** * Order by total path cost */ public int compareTo(TranslationPath tp) { if (tp.getPathCost() > this.getPathCost()) { return -1; } else if (tp.getPathCost() < this.getPathCost()) { return 1; } else { return 0; } }
/** * Order by total path cost */ public int compareTo(TranslationPath tp) { if (tp.getPathCost() > this.getPathCost()) { return -1; } else if (tp.getPathCost() < this.getPathCost()) { return 1; } else { return 0; } }
/** * Order by total path cost */ public int compareTo(TranslationPath tp) { if (tp.getPathCost() > this.getPathCost()) { return -1; } else if (tp.getPathCost() < this.getPathCost()) { return 1; } else { return 0; } }