- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 23 Aug 2012 15:15:41 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/values
In directory hutz:/tmp/cvs-serv30048/values
Modified Files:
CssIdent.java
Log Message:
comparable for sorting
Index: CssIdent.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/values/CssIdent.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- CssIdent.java 4 Aug 2012 21:17:07 -0000 1.12
+++ CssIdent.java 23 Aug 2012 15:15:39 -0000 1.13
@@ -13,7 +13,7 @@
/**
* @version $Revision$
*/
-public class CssIdent extends CssValue {
+public class CssIdent extends CssValue implements Comparable<CssIdent> {
public static HashMap<String, CssIdent> cachedValues;
@@ -42,6 +42,16 @@
public static final int type = CssTypes.CSS_IDENT;
+ public int compareTo(CssIdent other) {
+ int hash, ohash;
+ hash = hashCode();
+ ohash = other.hashCode();
+ if (hash == ohash) {
+ return 0;
+ }
+ return (hash < ohash) ? 1 : -1;
+ }
+
private int hashcode = 0;
public final int getType() {
Received on Thursday, 23 August 2012 15:15:46 UTC