You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by ju...@apache.org on 2002/05/07 10:17:09 UTC
cvs commit: jakarta-slide/src/share/org/apache/slide/macro CopyRouteRedirector.java
juergen 02/05/07 01:17:09
Modified: src/share/org/apache/slide/macro CopyRouteRedirector.java
Log:
Added toString(), equals() and hashCode() implementation to inner class CopyRoute.
(ralf)
Revision Changes Path
1.2 +43 -5 jakarta-slide/src/share/org/apache/slide/macro/CopyRouteRedirector.java
Index: CopyRouteRedirector.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/CopyRouteRedirector.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CopyRouteRedirector.java 7 May 2002 07:28:23 -0000 1.1
+++ CopyRouteRedirector.java 7 May 2002 08:17:09 -0000 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/CopyRouteRedirector.java,v 1.1 2002/05/07 07:28:23 juergen Exp $
- * $Revision: 1.1 $
- * $Date: 2002/05/07 07:28:23 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/CopyRouteRedirector.java,v 1.2 2002/05/07 08:17:09 juergen Exp $
+ * $Revision: 1.2 $
+ * $Date: 2002/05/07 08:17:09 $
*
* ====================================================================
*
@@ -70,7 +70,7 @@
* control on the <code>copy</code> operation. A CopyRouteRedirector
* may either return the given CopyRoute or any (redirected) CopyRoute.
*
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*
* @author <a href="mailto:ralf.stuckert@softwareag.com">Ralf Stuckert</a>
**/
@@ -81,7 +81,7 @@
* A CopyRoute defines the source and the destination URI of a
* <code>copy</code> operation.
*
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*
* @author <a href="mailto:ralf.stuckert@softwareag.com">Ralf Stuckert</a>
**/
@@ -151,6 +151,44 @@
*/
public String getDestinationUri() {
return destinationUri;
+ }
+
+ /**
+ * Returns a String representation of the CopyRoute.
+ *
+ * @return a String representation of the CopyRoute.
+ */
+ public String toString() {
+ return "CopyRoute["+getSourceUri()+", "+getDestinationUri()+"]";
+ }
+
+ /**
+ * Returns <code>true</code> if the other Object is a CopyRoute
+ * and both routes source and destination URIs are equal.
+ *
+ * @param other the Object to test for equality.
+ *
+ * @return <code>true</code> if the other Object is a CopyRoute
+ * and both routes source and destination URIs are equal.
+ */
+ public boolean equals(Object other) {
+ boolean isEqual = false;
+ if (other instanceof CopyRoute) {
+ isEqual =
+ ((CopyRoute)other).getSourceUri().equals(getSourceUri()) &&
+ ((CopyRoute)other).getDestinationUri().equals(getDestinationUri());
+ }
+ return isEqual;
+ }
+
+ /**
+ * Returns the hash code of this instance.
+ * Due to specification equal objects must have the same hash code.
+ *
+ * @return the hash code of this instance.
+ */
+ public int hashCode() {
+ return getSourceUri().hashCode() + 13*getDestinationUri().hashCode();
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>