Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F19D568E7 for ; Thu, 16 Jun 2011 18:59:34 +0000 (UTC) Received: (qmail 38083 invoked by uid 500); 16 Jun 2011 18:59:34 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 38033 invoked by uid 500); 16 Jun 2011 18:59:34 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 38026 invoked by uid 99); 16 Jun 2011 18:59:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jun 2011 18:59:34 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jun 2011 18:59:32 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 552FD23889F7; Thu, 16 Jun 2011 18:59:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1136601 - /commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/model/BaseLabeledEdge.java Date: Thu, 16 Jun 2011 18:59:11 -0000 To: commits@commons.apache.org From: simonetripodi@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110616185911.552FD23889F7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: simonetripodi Date: Thu Jun 16 18:59:10 2011 New Revision: 1136601 URL: http://svn.apache.org/viewvc?rev=1136601&view=rev Log: implemented equals/hashCode methods Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/model/BaseLabeledEdge.java Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/model/BaseLabeledEdge.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/model/BaseLabeledEdge.java?rev=1136601&r1=1136600&r2=1136601&view=diff ============================================================================== --- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/model/BaseLabeledEdge.java (original) +++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/model/BaseLabeledEdge.java Thu Jun 16 18:59:10 2011 @@ -69,6 +69,83 @@ public class BaseLabeledEdge other = (BaseLabeledEdge) obj; + + if ( head == null ) + { + if ( other.getHead() != null ) + { + return false; + } + } + else if ( !head.equals( other.getHead() ) ) + { + return false; + } + + if ( tail == null ) + { + if ( other.getTail() != null ) + { + return false; + } + } + else if ( !tail.equals( other.getTail() ) ) + { + return false; + } + + if ( label == null ) + { + if ( other.getLabel() != null ) + { + return false; + } + } + else if ( !label.equals( other.label ) ) + { + return false; + } + + return true; + } + + /** + * {@inheritDoc} + */ + @Override public String toString() { return format( "Edge(label=%s, head=%s, tail=%s)", label, head.getLabel(), tail.getLabel() );