Update of /var/cvs/applications/vwms/src/org/mmbase/util
In directory james.mmbase.org:/tmp/cvs-serv32657
Modified Files:
SortedVector.java
Added Files:
DateSupport.java
Log Message:
made it compatible with any List arguments
See also: http://cvs.mmbase.org/viewcvs/applications/vwms/src/org/mmbase/util
DateSupport.java is new
Index: SortedVector.java
===================================================================
RCS file: /var/cvs/applications/vwms/src/org/mmbase/util/SortedVector.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- SortedVector.java 21 Jun 2007 15:50:22 -0000 1.2
+++ SortedVector.java 3 Sep 2008 15:13:01 -0000 1.3
@@ -11,6 +11,7 @@
import java.util.Vector;
import java.util.Enumeration;
+import java.util.List;
import org.mmbase.util.logging.*;
/**
@@ -23,7 +24,7 @@
* Todo: Remove duplicate code for the binary search
* @deprecated You can use java.util.SortedSet (implementations of that), or
Collections.sort(), if duplicate entries are essential (but how should they be
sorted then?)
* @author Rico Jansen
- * @version $Id: SortedVector.java,v 1.2 2007/06/21 15:50:22 nklasens Exp $
+ * @version $Id: SortedVector.java,v 1.3 2008/09/03 15:13:01 michiel Exp $
*/
public class SortedVector extends java.util.Vector {
@@ -268,7 +269,7 @@
* otherwise use SortVector(Vector,CompareInterface) to specify
* the interface
*/
- public static SortedVector SortVector(Vector<String> vec) {
+ public static SortedVector SortVector(List<String> vec) {
SortedVector newvec=new SortedVector();
for (String string : vec) {
@@ -282,11 +283,11 @@
* Sort a Vector and return a SortedVector using the specified compare
* function.
*/
- public static SortedVector SortVector(Vector vec,CompareInterface cmpI) {
+ public static SortedVector SortVector(List vec,CompareInterface cmpI) {
SortedVector newvec=new SortedVector(cmpI);
- for (Enumeration e=vec.elements();e.hasMoreElements();) {
- newvec.addElement(e.nextElement());
+ for (Object o : vec) {
+ newvec.addElement(o);
}
newvec.Sort();
return newvec;
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs