W3C home > Mailing lists > Public > www-validator-cvs@w3.org > October 2009

2006/unicorn/src/org/w3c/unicorn/util UCNProperties.java,1.5,1.6

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Tue, 13 Oct 2009 15:08:58 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1Mxizi-0000pV-MB@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/util
In directory hutz:/tmp/cvs-serv3168/src/org/w3c/unicorn/util

Modified Files:
	UCNProperties.java 
Log Message:
keys are now sorted alphabetically

Index: UCNProperties.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/util/UCNProperties.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- UCNProperties.java	6 Oct 2009 08:17:25 -0000	1.5
+++ UCNProperties.java	13 Oct 2009 15:08:56 -0000	1.6
@@ -1,6 +1,9 @@
 package org.w3c.unicorn.util;
 
+import java.util.Collections;
+import java.util.Enumeration;
 import java.util.Properties;
+import java.util.Vector;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -48,6 +51,16 @@
 		}
 	}
 
+	@SuppressWarnings("unchecked")
+	public Enumeration keys() {
+		Enumeration keysEnum = super.keys();
+		Vector<String> keyList = new Vector<String>();
+		while(keysEnum.hasMoreElements())
+			keyList.add((String)keysEnum.nextElement());
+		Collections.sort(keyList);
+		return keyList.elements();
+	}
+	
 	@Override
 	public String toString() {
 		String result = "";
Received on Tuesday, 13 October 2009 15:09:02 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:39 UTC