/** * The default implementation of this method is to call * first.namespaceCompareTo(second). Subclasses may override. * * @param first * the first id to compare. Must not be <code>null</code>. * @param second * the second id to compare. Must not be <code>null</code>. * @return int as specified by {@link Comparable}. */ protected int getCompareToForObject(BaseID first, BaseID second) { return first.namespaceCompareTo(second); }
/** * The default implementation of this method is to call * id.namespaceGetName(). Subclasses may override. * * @param id * the ID to get the name for. Must not be <code>null</code>. * @return String that is the unique name for the given id within this * Namespace. */ protected String getNameForID(BaseID id) { return id.namespaceGetName(); }
/** * The default implementation of this method is to call * id.namespaceHashCode(). Subclasses may override. * * @param id * the id in this Namespace to get the hashcode for. Must not be * <code>null</code>. * @return the hashcode for the given id. Returned value must be unique * within this process. */ protected int getHashCodeForID(BaseID id) { return id.namespaceHashCode(); }
/** * Test whether two IDs are equal to one another. * * @param first * the first ID. Must not be <code>null</code>. * @param second * the second ID. Must not be <code>null</code>. * @return <code>true</code> if this ID is equal to the given ID. * <code>false</code> otherwise. */ protected boolean testIDEquals(BaseID first, BaseID second) { // First check that namespaces are the same and non-null Namespace sn = second.getNamespace(); if (sn == null || !this.equals(sn)) return false; return first.namespaceEquals(second); }
protected int namespaceCompareTo(BaseID obj) { return getName().compareTo(obj.getName()); }
public int hashCode() { setEmptyNamespace(); return super.hashCode(); }
public int compareTo(Object o) { setEmptyNamespace(); return super.compareTo(o); }
public boolean equals(Object o) { setEmptyNamespace(); return super.equals(o); }
/** * The default implementation of this method is to call * id.namespaceToExternalForm(). Subclasses may override. * * @param id * the id in this Namespace to convert to external form. * @return String that represents the given id in an external form. Note * that this external form may at some later time be passed to * {@link #createInstance(Object[])} as a single String parameter, * and should result in a valid ID instance of the appropriate * Namespace. */ protected String toExternalForm(BaseID id) { return id.namespaceToExternalForm(); }
/** * Test whether two IDs are equal to one another. * * @param first * the first ID. Must not be <code>null</code>. * @param second * the second ID. Must not be <code>null</code>. * @return <code>true</code> if this ID is equal to the given ID. * <code>false</code> otherwise. */ protected boolean testIDEquals(BaseID first, BaseID second) { // First check that namespaces are the same and non-null Namespace sn = second.getNamespace(); if (sn == null || !this.equals(sn)) return false; return first.namespaceEquals(second); }
public String getName() { setEmptyNamespace(); return super.getName(); }
public int hashCode() { setEmptyNamespace(); return super.hashCode(); }
public int compareTo(Object o) { setEmptyNamespace(); return super.compareTo(o); }
public boolean equals(Object o) { setEmptyNamespace(); return super.equals(o); }
/** * The default implementation of this method is to call * id.namespaceToExternalForm(). Subclasses may override. * * @param id * the id in this Namespace to convert to external form. * @return String that represents the given id in an external form. Note * that this external form may at some later time be passed to * {@link #createInstance(Object[])} as a single String parameter, * and should result in a valid ID instance of the appropriate * Namespace. */ protected String toExternalForm(BaseID id) { return id.namespaceToExternalForm(); }
public String getName() { setEmptyNamespace(); return super.getName(); }
/** * The default implementation of this method is to call * id.namespaceGetName(). Subclasses may override. * * @param id * the ID to get the name for. Must not be <code>null</code>. * @return String that is the unique name for the given id within this * Namespace. */ protected String getNameForID(BaseID id) { return id.namespaceGetName(); }
/** * The default implementation of this method is to call * first.namespaceCompareTo(second). Subclasses may override. * * @param first * the first id to compare. Must not be <code>null</code>. * @param second * the second id to compare. Must not be <code>null</code>. * @return int as specified by {@link Comparable}. */ protected int getCompareToForObject(BaseID first, BaseID second) { return first.namespaceCompareTo(second); }
/** * The default implementation of this method is to call * id.namespaceHashCode(). Subclasses may override. * * @param id * the id in this Namespace to get the hashcode for. Must not be * <code>null</code>. * @return the hashcode for the given id. Returned value must be unique * within this process. */ protected int getHashCodeForID(BaseID id) { return id.namespaceHashCode(); }
protected int namespaceCompareTo(BaseID obj) { return getName().compareTo(obj.getName()); }