Return-Path: Delivered-To: apmail-avalon-cvs-archive@avalon.apache.org Received: (qmail 30446 invoked by uid 500); 12 Jul 2003 13:34:29 -0000 Mailing-List: contact cvs-help@avalon.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list cvs@avalon.apache.org Received: (qmail 30435 invoked by uid 500); 12 Jul 2003 13:34:29 -0000 Received: (qmail 30432 invoked from network); 12 Jul 2003 13:34:28 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 12 Jul 2003 13:34:28 -0000 Received: (qmail 96438 invoked by uid 1438); 12 Jul 2003 13:34:28 -0000 Date: 12 Jul 2003 13:34:28 -0000 Message-ID: <20030712133428.96437.qmail@icarus.apache.org> From: mcconnell@apache.org To: avalon-sandbox-cvs@apache.org Subject: cvs commit: avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info CategoryDescriptor.java ContextDescriptor.java DependencyDescriptor.java Descriptor.java EntryDescriptor.java ExtensionDescriptor.java InfoDescriptor.java ReferenceDescriptor.java Service.java ServiceDescriptor.java StageDescriptor.java Type.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N mcconnell 2003/07/12 06:34:28 Modified: meta/api/src/java/org/apache/avalon/meta/info CategoryDescriptor.java ContextDescriptor.java DependencyDescriptor.java Descriptor.java EntryDescriptor.java ExtensionDescriptor.java InfoDescriptor.java ReferenceDescriptor.java Service.java ServiceDescriptor.java StageDescriptor.java Type.java Log: Housekeeping - javadoc and a couple of additional equals() and hashCodes(). Revision Changes Path 1.4 +27 -1 avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/CategoryDescriptor.java Index: CategoryDescriptor.java =================================================================== RCS file: /home/cvs/avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/CategoryDescriptor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- CategoryDescriptor.java 11 Jul 2003 13:02:27 -0000 1.3 +++ CategoryDescriptor.java 12 Jul 2003 13:34:27 -0000 1.4 @@ -107,4 +107,30 @@ { return m_name; } + + /** + * Test is the supplied object is equal to this object. + * @return true if the object are equivalent + */ + public boolean equals( Object other ) + { + boolean isEqual = other instanceof CategoryDescriptor; + if ( isEqual ) + { + isEqual = isEqual && m_name.equals( ((CategoryDescriptor)other).m_name ); + } + return isEqual; + } + + /** + * Return the hashcode for the object. + * @return the hashcode value + */ + public int hashCode() + { + int hash = super.hashCode(); + hash >>>= 13; + hash ^= m_name.hashCode(); + return hash; + } } 1.5 +25 -1 avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/ContextDescriptor.java Index: ContextDescriptor.java =================================================================== RCS file: /home/cvs/avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/ContextDescriptor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ContextDescriptor.java 12 Jul 2003 13:09:25 -0000 1.4 +++ ContextDescriptor.java 12 Jul 2003 13:34:27 -0000 1.5 @@ -208,6 +208,30 @@ return (EntryDescriptor[]) list.toArray( new EntryDescriptor[0] ); } + /** + * Test is the supplied object is equal to this object. + * @return true if the object are equivalent + */ + public boolean equals( Object other ) + { + boolean isEqual = super.equals( other ); + if( isEqual ) isEqual = other instanceof ContextDescriptor; + if( isEqual ) + { + ContextDescriptor entity = (ContextDescriptor) other; + isEqual = isEqual && m_reference.equals( entity.m_reference ); + for( int i=0; i>>= 13; + hash ^= m_key.hashCode(); hash >>>= 13; hash ^= m_classname.hashCode(); hash >>>= 13; 1.4 +9 -1 avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/ExtensionDescriptor.java Index: ExtensionDescriptor.java =================================================================== RCS file: /home/cvs/avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/ExtensionDescriptor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ExtensionDescriptor.java 11 Jul 2003 16:19:45 -0000 1.3 +++ ExtensionDescriptor.java 12 Jul 2003 13:34:27 -0000 1.4 @@ -117,6 +117,10 @@ return m_reference; } + /** + * Test is the supplied object is equal to this object. + * @return true if the object are equivalent + */ public boolean equals(Object other) { boolean isEqual = super.equals(other) && other instanceof ExtensionDescriptor; @@ -126,6 +130,10 @@ return isEqual; } + /** + * Return the hashcode for the object. + * @return the hashcode value + */ public int hashCode() { int hash = super.hashCode(); 1.6 +9 -1 avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/InfoDescriptor.java Index: InfoDescriptor.java =================================================================== RCS file: /home/cvs/avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/InfoDescriptor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- InfoDescriptor.java 12 Jul 2003 13:11:06 -0000 1.5 +++ InfoDescriptor.java 12 Jul 2003 13:34:27 -0000 1.6 @@ -244,6 +244,10 @@ return "[" + getName() + "] " + getClassname() + ":" + getVersion(); } + /** + * Test is the supplied object is equal to this object. + * @return true if the object are equivalent + */ public boolean equals(Object other) { boolean isEqual = super.equals(other) && other instanceof InfoDescriptor; @@ -268,6 +272,10 @@ return isEqual; } + /** + * Return the hashcode for the object. + * @return the hashcode value + */ public int hashCode() { int hash = super.hashCode(); 1.7 +10 -10 avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/ReferenceDescriptor.java Index: ReferenceDescriptor.java =================================================================== RCS file: /home/cvs/avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/ReferenceDescriptor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ReferenceDescriptor.java 12 Jul 2003 08:40:32 -0000 1.6 +++ ReferenceDescriptor.java 12 Jul 2003 13:34:27 -0000 1.7 @@ -159,15 +159,6 @@ } /** - * Returns the cashcode. - * @return the hascode value - */ - public int hashCode() - { - return getClassname().hashCode() ^ getVersion().hashCode(); - } - - /** * Compare this object with another for equality. * @param other the object to compare this object with * @return TRUE if the supplied object is a reference, service, or service @@ -191,6 +182,15 @@ } return match; + } + + /** + * Returns the cashcode. + * @return the hascode value + */ + public int hashCode() + { + return getClassname().hashCode() ^ getVersion().hashCode(); } private static final String parseClassname( final String type ) 1.4 +3 -3 avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/Service.java Index: Service.java =================================================================== RCS file: /home/cvs/avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/Service.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Service.java 11 Jul 2003 20:03:22 -0000 1.3 +++ Service.java 12 Jul 2003 13:34:27 -0000 1.4 @@ -203,8 +203,8 @@ } /** - * Return the hascode for this service defintion. - * @return the hascode value + * Return the hashcode for this service defintion. + * @return the hashcode value */ public int hashCode() { 1.4 +5 -1 avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/ServiceDescriptor.java Index: ServiceDescriptor.java =================================================================== RCS file: /home/cvs/avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/ServiceDescriptor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ServiceDescriptor.java 11 Jul 2003 20:22:54 -0000 1.3 +++ ServiceDescriptor.java 12 Jul 2003 13:34:27 -0000 1.4 @@ -147,6 +147,10 @@ return m_designator.hashCode(); } + /** + * Test is the supplied object is equal to this object. + * @return true if the object are equivalent + */ public boolean equals(Object other) { boolean isEqual = super.equals( other ) && other instanceof ServiceDescriptor; 1.4 +9 -1 avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/StageDescriptor.java Index: StageDescriptor.java =================================================================== RCS file: /home/cvs/avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/StageDescriptor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- StageDescriptor.java 11 Jul 2003 20:22:54 -0000 1.3 +++ StageDescriptor.java 12 Jul 2003 13:34:27 -0000 1.4 @@ -126,6 +126,10 @@ return m_reference.hashCode(); } + /** + * Test is the supplied object is equal to this object. + * @return true if the object are equivalent + */ public boolean equals(Object other) { boolean isEqual = super.equals(other) && other instanceof StageDescriptor; @@ -133,6 +137,10 @@ return isEqual; } + /** + * Return a stringified representation of the instance. + * @return the string representation + */ public String toString() { return "[stage " + getReference() + "]"; 1.9 +9 -1 avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/Type.java Index: Type.java =================================================================== RCS file: /home/cvs/avalon-sandbox/meta/api/src/java/org/apache/avalon/meta/info/Type.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Type.java 12 Jul 2003 13:11:55 -0000 1.8 +++ Type.java 12 Jul 2003 13:34:27 -0000 1.9 @@ -376,6 +376,10 @@ return getInfo().toString(); } + /** + * Test is the supplied object is equal to this object. + * @return true if the object are equivalent + */ public boolean equals(Object other) { boolean isEqual = other instanceof Type; @@ -405,6 +409,10 @@ return isEqual; } + /** + * Return the hashcode for the object. + * @return the hashcode value + */ public int hashCode() { int hash = m_descriptor.hashCode(); --------------------------------------------------------------------- To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org For additional commands, e-mail: cvs-help@avalon.apache.org