ruper2/src/java/core/org/krysalis/ruper/util/identity GenericNamespace.java,1.2,1.3

[email protected]
Newsgroups gmane.comp.krysalis.metamorphosis.cvs
Message-ID <[email protected]>
Update of /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/util/identity
In directory sc8-pr-cvs1:/tmp/cvs-serv13239/src/java/core/org/krysalis/ruper/util/identity

Modified Files:
	GenericNamespace.java 
Log Message:
Comparator

Index: GenericNamespace.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/util/identity/GenericNamespace.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** GenericNamespace.java	5 Sep 2003 15:54:43 -0000	1.2
--- GenericNamespace.java	6 Sep 2003 23:01:16 -0000	1.3
***************
*** 8,12 ****
   * @author arb_jack
   */
! public class GenericNamespace {
  
  	private String m_uri = null;
--- 8,12 ----
   * @author arb_jack
   */
! public class GenericNamespace implements Comparable {
  
  	private String m_uri = null;
***************
*** 75,78 ****
--- 75,98 ----
  	}
  
+ 	/* (non-Javadoc)
+ 	 * @see java.lang.Object#compareTo(java.lang.Object)
+ 	 */
+ 	public int compareTo(Object other) {
+ 		int comparison = 0;
+ 
+ 		if (other instanceof GenericNamespace) {
+ 			GenericNamespace otherNS = (GenericNamespace) other;
+ 
+ 			// Sort in prefix order
+ 			comparison = m_prefix.compareToIgnoreCase(otherNS.m_prefix);
+ 		}
+ 		else {
+ 			throw new IllegalArgumentException(
+ 				"Not a GenericNamespace: " + other.getClass().getName());
+ 		}
+ 
+ 		return comparison;
+ 	}
+ 	
  	/* (non-Javadoc)
  	 * @see java.lang.Object#hashCode()




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.