/** * implement Comparable<LibraryDependency> so that the L2pClassLoader may keep a (sorted) TreeMap * of all registered Libraries * * @return comparison code */ @Override public int compareTo(LibraryIdentifier other) { if (this.getName().equals(other.getName())) return this.getVersion().compareTo(other.getVersion()); else return this.getName().compareTo(other.getName()); }
/** * compares this identifier to another one * * @param i * @return true, if the given identifier is the same as this */ public boolean equals(LibraryIdentifier i) { return this.toString().equals(i.toString()); }
@Override public Void visitLibraryIdentifier(LibraryIdentifier node) { writer.print(node.getName()); return null; }