/** * Test this entry for equality to another. * <p/> * <p/> * Consistent with {@link #compareTo}, this method tests * for equality purely on the package name. * </p> * * @param thatObj The object to compare * @return <code>true</code> if the two objects are * semantically equivalent, otherwise <code>false</code>. */ public boolean equals( Object thatObj ) { Entry that = (Entry) thatObj; return getPackageName().equals( that.getPackageName() ); }
/** * Determine if the classname matches the package * described by this entry. * * @param classname The class name to test. * @return <code>true</code> if this entry matches the * classname, otherwise <code>false</code>. */ boolean matches( String classname ) { return classname.startsWith( getPackageName() ); }
/** * <p/> * Consistent with {@link #equals}, this method creates a hashCode * based on the packagename. * </p> */ public int hashCode() { return getPackageName().hashCode(); } }
/** Determine if the classname matches the package * described by this entry. * * @param classname The class name to test. * * @return <code>true</code> if this entry matches the * classname, otherwise <code>false</code>. */ boolean matches(String classname) { return classname.startsWith( getPackageName() ); }
/** * <p> * Consistent with {@link #equals}, this method creates a hashCode * based on the packagename. * </p> */ public int hashCode() { return getPackageName().hashCode(); } }
/** Test this entry for equality to another. * * <p> * Consistent with {@link #compareTo}, this method tests * for equality purely on the package name. * </p> * * @param thatObj The object to compare * * @return <code>true</code> if the two objects are * semantically equivalent, otherwise <code>false</code>. */ public boolean equals(Object thatObj) { Entry that = (Entry) thatObj; return getPackageName().equals( that.getPackageName() ); }
/** * Compare this entry to another for relative ordering. * <p/> * <p/> * The natural ordering of Entry objects is reverse-alphabetical * based upon package name. * </p> * * @param thatObj The object to compare. * @return -1 if this object sorts before that object, 0 * if they are equal, or 1 if this object sorts * after that object. */ public int compareTo( Object thatObj ) { Entry that = (Entry) thatObj; // We are reverse sorting this list, so that // we get longer matches first: // // com.werken.foo.bar // com.werken.foo // com.werken return ( getPackageName().compareTo( that.getPackageName() ) ) * -1; }
/** Compare this entry to another for relative ordering. * * <p> * The natural ordering of Entry objects is reverse-alphabetical * based upon package name. * </p> * * @param thatObj The object to compare. * * @return -1 if this object sorts before that object, 0 * if they are equal, or 1 if this object sorts * after that object. */ public int compareTo(Object thatObj) { Entry that = (Entry) thatObj; // We are reverse sorting this list, so that // we get longer matches first: // // com.werken.foo.bar // com.werken.foo // com.werken return ( getPackageName().compareTo( that.getPackageName() ) ) * -1; }