Methods Summary |
---|
public static java.util.Enumeration | append(java.util.Enumeration e1, java.util.Enumeration e2)Append one enumeration to another.
Elements are evaluated lazily.
return new CompoundEnumeration(e1, e2);
|
public static java.util.Enumeration | asEnumeration(java.util.Iterator iter)Adapt the specified Iterator to the Enumeration interface.
return new Enumeration() {
public boolean hasMoreElements() {
return iter.hasNext();
}
public Object nextElement() {
return iter.next();
}
};
|
public static java.util.Iterator | asIterator(java.util.Enumeration e)Adapt the specified Enumeration to the Iterator interface.
return new Iterator() {
public boolean hasNext() {
return e.hasMoreElements();
}
public Object next() {
return e.nextElement();
}
public void remove() {
throw new UnsupportedOperationException();
}
};
|
public static boolean | equals(java.util.Vector v1, java.util.Vector v2)Please use Vector.equals() or List.equals().
if (v1 == v2) {
return true;
}
if (v1 == null || v2 == null) {
return false;
}
return v1.equals(v2);
|
public static boolean | equals(java.util.Dictionary d1, java.util.Dictionary d2)Dictionary does not have an equals.
Please use Map.equals().
Follows the equals contract of Java 2's Map.
if (d1 == d2) {
return true;
}
if (d1 == null || d2 == null) {
return false;
}
if (d1.size() != d2.size()) {
return false;
}
Enumeration e1 = d1.keys();
while (e1.hasMoreElements()) {
Object key = e1.nextElement();
Object value1 = d1.get(key);
Object value2 = d2.get(key);
if (value2 == null || !value1.equals(value2)) {
return false;
}
}
// don't need the opposite check as the Dictionaries have the
// same size, so we've also covered all keys of d2 already.
return true;
|
public static void | putAll(java.util.Dictionary m1, java.util.Dictionary m2)Dictionary does not know the putAll method. Please use Map.putAll().
for (Enumeration it = m2.keys(); it.hasMoreElements();) {
Object key = it.nextElement();
m1.put(key, m2.get(key));
}
|