Merge branch 'master' of oss.readytalk.com:/var/local/git/avian

This commit is contained in:
Joel Dice 2008-07-11 18:11:29 -06:00
commit dc52bae1cf
7 changed files with 115 additions and 156 deletions

View File

@ -11,11 +11,11 @@
package java.lang;
public interface CharSequence {
public char charAt(int index);
int length();
CharSequence subSequence(int start, int end);
String toString();
public char charAt(int index);
int length();
CharSequence subSequence(int start, int end);
String toString();
}

View File

@ -417,6 +417,6 @@ public final class Class <T> {
}
public boolean desiredAssertionStatus() {
return false;
return false;
}
}

View File

@ -44,12 +44,12 @@ public final class String implements Comparable<String>, CharSequence {
public String(byte[] data, String charset)
throws UnsupportedEncodingException
{
this(data);
if (! charset.equals("US-ASCII")) {
throw new UnsupportedEncodingException(charset);
{
this(data);
if (! charset.equals("US-ASCII")) {
throw new UnsupportedEncodingException(charset);
}
}
}
private String(Object data, int offset, int length, boolean copy) {
int l;
@ -253,11 +253,11 @@ public final class String implements Comparable<String>, CharSequence {
if (data instanceof char[]) {
char[] buf = new char[length];
for (int i=0; i < length; i++) {
if (charAt(i) == oldChar) {
buf[i] = newChar;
} else {
buf[i] = charAt(i);
}
if (charAt(i) == oldChar) {
buf[i] = newChar;
} else {
buf[i] = charAt(i);
}
}
return new String(buf, 0, length, false);
} else {
@ -266,11 +266,11 @@ public final class String implements Comparable<String>, CharSequence {
byte oldByte = (byte)oldChar;
byte newByte = (byte)newChar;
for (int i=0; i < length; i++) {
if (orig[i+offset] == oldByte) {
buf[i] = newByte;
} else {
buf[i] = orig[i+offset];
}
if (orig[i+offset] == oldByte) {
buf[i] = newByte;
} else {
buf[i] = orig[i+offset];
}
}
return new String(buf, 0, length, false);
}
@ -425,9 +425,9 @@ public final class String implements Comparable<String>, CharSequence {
return array;
}
public CharSequence subSequence(int start, int end) {
return substring(start, end);
}
public CharSequence subSequence(int start, int end) {
return substring(start, end);
}
public native String intern();

View File

@ -295,7 +295,7 @@ public class StringBuilder implements CharSequence {
getChars(start, len, buf,0 );
return new String(buf, 0, len, false);
}
public CharSequence subSequence(int start, int end) {
return substring(start, end);
}

View File

@ -21,9 +21,9 @@ import java.io.FileDescriptor;
public abstract class System {
private static Property properties;
// static {
// loadLibrary("natives");
// }
// static {
// loadLibrary("natives");
// }
public static final PrintStream out = new PrintStream
(new BufferedOutputStream(new FileOutputStream(FileDescriptor.out)), true);
@ -55,11 +55,11 @@ public abstract class System {
}
public static String getProperty(String name, String defaultValue) {
String result = getProperty(name);
if (result==null) {
return defaultValue;
}
return result;
String result = getProperty(name);
if (result==null) {
return defaultValue;
}
return result;
}

View File

@ -15,98 +15,57 @@ package java.util;
*
*/
public abstract class AbstractCollection<T> implements Collection<T> {
public boolean add(T element) {
throw new UnsupportedOperationException("adding to "
+ this.getClass().getName());
}
/*
* (non-Javadoc)
*
* @see java.util.Collection#add(java.lang.Object)
*/
public boolean add(T element) {
throw new UnsupportedOperationException("adding to "
+ this.getClass().getName());
}
public boolean addAll(Collection<? extends T> collection) {
boolean result = false;
for (T obj : collection) {
result |= add(obj);
}
return result;
}
/*
* (non-Javadoc)
*
* @see java.util.Collection#addAll(java.util.Collection)
*/
public boolean addAll(Collection<? extends T> collection) {
boolean result = false;
for (T obj : collection) {
result |= add(obj);
}
return result;
}
public void clear() {
throw new UnsupportedOperationException("clear() in "
+ this.getClass().getName());
}
/*
* (non-Javadoc)
*
* @see java.util.Collection#clear()
*/
public void clear() {
throw new UnsupportedOperationException("clear() in "
+ this.getClass().getName());
}
public boolean contains(T element) {
if (element != null) {
for (Iterator<T> iter = iterator(); iter.hasNext();) {
if (element.equals(iter.next())) {
return true;
}
}
} else {
for (Iterator<T> iter = iterator(); iter.hasNext();) {
if (iter.next()==null) {
return true;
}
}
}
return false;
}
/*
* (non-Javadoc)
*
* @see java.util.Collection#contains(java.lang.Object)
*/
public boolean contains(T element) {
if (element != null) {
for (Iterator<T> iter = iterator(); iter.hasNext();) {
if (element.equals(iter.next())) {
return true;
}
}
} else {
for (Iterator<T> iter = iterator(); iter.hasNext();) {
if (iter.next()==null) {
return true;
}
}
}
return false;
}
public boolean isEmpty() {
return size() == 0;
}
/*
* (non-Javadoc)
*
* @see java.util.Collection#isEmpty()
*/
public boolean isEmpty() {
return size() == 0;
}
public boolean remove(T element) {
throw new UnsupportedOperationException("remove(T) in "
+ this.getClass().getName());
}
/*
* (non-Javadoc)
*
* @see java.util.Collection#remove(java.lang.Object)
*/
public boolean remove(T element) {
throw new UnsupportedOperationException("remove(T) in "
+ this.getClass().getName());
}
public abstract int size();
/*
* (non-Javadoc)
*
* @see java.util.Collection#size()
*/
public abstract int size();
public <S> S[] toArray(S[] array) {
return Collections.toArray(this, array);
}
/*
* (non-Javadoc)
*
* @see java.util.Collection#toArray(S[])
*/
public <S> S[] toArray(S[] array) {
return Collections.toArray(this, array);
}
public abstract Iterator<T> iterator();
public abstract Iterator<T> iterator();
}

View File

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