You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@apache.org on 2001/03/15 06:00:07 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/xni QName.java
andyc 01/03/14 21:00:07
Modified: java/src/org/apache/xerces/xni Tag: xerces_j_2 QName.java
Log:
1) Made QName cloneable.
2) Implemented quick-n-dirty hashCode and equals methods.
Revision Changes Path
No revision
No revision
1.1.2.4 +26 -2 xml-xerces/java/src/org/apache/xerces/xni/Attic/QName.java
Index: QName.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/QName.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- QName.java 2000/10/10 08:04:57 1.1.2.3
+++ QName.java 2001/03/15 05:00:07 1.1.2.4
@@ -70,9 +70,10 @@
* @author Stubs generated by DesignDoc on Wed Jun 07 11:58:44 PDT 2000
* @author Andy Clark, IBM
*
- * @version $Id: QName.java,v 1.1.2.3 2000/10/10 08:04:57 andyc Exp $
+ * @version $Id: QName.java,v 1.1.2.4 2001/03/15 05:00:07 andyc Exp $
*/
-public class QName {
+public class QName
+ implements Cloneable {
//
// Data
@@ -162,8 +163,31 @@
} // clear()
//
+ // Cloneable methods
+ //
+
+ /** Returns a clone of this object. */
+ public Object clone() {
+ return new QName(this);
+ } // clone():Object
+
+ //
// Object methods
//
+
+ /** Returns the hashcode for this object. */
+ public int hashCode() {
+ return toString().hashCode();
+ } // hashCode():int
+
+ /** Returns true if the two objects are equal. */
+ public boolean equals(Object object) {
+ if (object instanceof QName) {
+ QName qname = (QName)object;
+ return qname.toString().equals(toString());
+ }
+ return false;
+ } // equals(Object):boolean
/** Returns a string representation of this object. */
public String toString() {
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org