/** * Returns the string representation of this compiled format */ public synchronized String toString() { if (fmtString == null) { StringBuffer sb = new StringBuffer(); toString(sb); } return fmtString; }
public int hashCode() { return 11 * toString().hashCode(); }
public boolean equals(Object o) { return this == o || o instanceof VersionFormat && toString().equals(o.toString()); }
private Object readResolve() { synchronized (formatCache) { String string = toString(); string = string.substring(7, string.length() - 1); // Strip of "format(" and ")" VersionFormat fmt = formatCache.get(string); if (fmt == null) { fmt = this; formatCache.put(string, fmt); } return fmt; } }