add a few classes and methods to the classpath

Add java.lang.CharSequence, java.util.AbstractSet,
java.util.AbstractCollection, Collections.unmodifiableSet,
 System.getProperty(String,String), etc.
This commit is contained in:
Zsombor
2008-07-03 09:16:32 -06:00
committed by Joel Dice
parent 107ac01304
commit e3fd0d9c7d
10 changed files with 226 additions and 14 deletions

View File

@ -187,4 +187,53 @@ public class Collections {
}
}
}
static class UnmodifiableSet<T> implements Set<T> {
Set<T> inner;
UnmodifiableSet(Set<T> inner) {
this.inner = inner;
}
public boolean add(T element) {
throw new UnsupportedOperationException("not supported");
}
public boolean addAll(Collection<? extends T> collection) {
throw new UnsupportedOperationException("not supported");
}
public void clear() {
throw new UnsupportedOperationException("not supported");
}
public boolean contains(T element) {
return inner.contains(element);
}
public boolean isEmpty() {
return inner.isEmpty();
}
public Iterator<T> iterator() {
return inner.iterator();
}
public boolean remove(T element) {
throw new UnsupportedOperationException("not supported");
}
public int size() {
return inner.size();
}
public <S> S[] toArray(S[] array) {
return inner.toArray(array);
}
}
public static <T> Set<T> unmodifiableSet(Set<T> hs) {
return new UnmodifiableSet<T>(hs);
}
}