mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-22 21:55:39 +00:00
bug6059: implemented a web socket server with Jetty/Jersey
This commit is contained in:
@@ -7,6 +7,7 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
@@ -1267,4 +1268,19 @@ public class Util {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static <T> Enumeration<T> getEnumerationFromIterable(Iterable<T> iterable) {
|
||||
return new Enumeration<T>() {
|
||||
final Iterator<T> i = iterable.iterator();
|
||||
@Override
|
||||
public boolean hasMoreElements() {
|
||||
return i.hasNext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public T nextElement() {
|
||||
return i.next();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user