diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-15 19:45:34 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-15 19:45:34 +0000 |
commit | 4a8fcbf1fe2f7cf2c80e4688115c3e49da1c31a9 (patch) | |
tree | 6325e924516b02fb0d87553b0923dd855f975914 /libjava/java/lang/CharSequence.java | |
parent | fcffb5ea0b1c2f8aef9c2237f0fc5a809ffc2003 (diff) | |
download | gcc-4a8fcbf1fe2f7cf2c80e4688115c3e49da1c31a9.tar.gz |
* java/lang/AbstractMethodError.java: Re-merged with Classpath.
* java/lang/ArithmeticException.java: Likewise.
* java/lang/ArrayIndexOutOfBoundsException.java: Likewise.
* java/lang/ArrayStoreException.java: Likewise.
* java/lang/Byte.java: Likewise.
* java/lang/CharSequence.java: Likewise.
* java/lang/ClassCastException.java: Likewise.
* java/lang/ClassCircularityError.java: Likewise.
* java/lang/ClassFormatError.java: Likewise.
* java/lang/CloneNotSupportedException.java: Likewise.
* java/lang/Cloneable.java: Likewise.
* java/lang/Comparable.java: Likewise.
* java/lang/Compiler.java: Likewise.
* java/lang/Error.java: Likewise.
* java/lang/ExceptionInInitializerError.java: Likewise.
* java/lang/IllegalAccessError.java: Likewise.
* java/lang/IllegalAccessException.java: Likewise.
* java/lang/IllegalArgumentException.java: Likewise.
* java/lang/IllegalMonitorStateException.java: Likewise.
* java/lang/IllegalStateException.java: Likewise.
* java/lang/IllegalThreadStateException.java: Likewise.
* java/lang/IncompatibleClassChangeError.java: Likewise.
* java/lang/IndexOutOfBoundsException.java: Likewise.
* java/lang/InheritableThreadLocal.java: Likewise.
* java/lang/InstantiationError.java: Likewise.
* java/lang/InstantiationException.java: Likewise.
* java/lang/InternalError.java: Likewise.
* java/lang/InterruptedException.java: Likewise.
* java/lang/LinkageError.java: Likewise.
* java/lang/NegativeArraySizeException.java: Likewise.
* java/lang/NoClassDefFoundError.java: Likewise.
* java/lang/NoSuchFieldError.java: Likewise.
* java/lang/NoSuchFieldException.java: Likewise.
* java/lang/NoSuchMethodError.java: Likewise.
* java/lang/NoSuchMethodException.java: Likewise.
* java/lang/NullPointerException.java: Likewise.
* java/lang/NumberFormatException.java: Likewise.
* java/lang/OutOfMemoryError.java: Likewise.
* java/lang/Process.java: Likewise.
* java/lang/Runnable.java: Likewise.
* java/lang/RuntimePermission.java: Likewise.
* java/lang/SecurityException.java: Likewise.
* java/lang/Short.java: Likewise.
* java/lang/StackOverflowError.java: Likewise.
* java/lang/StringIndexOutOfBoundsException.java: Likewise.
* java/lang/ThreadDeath.java: Likewise.
* java/lang/ThreadLocal.java: Likewise.
* java/lang/UnknownError.java: Likewise.
* java/lang/UnsatisfiedLinkError.java: Likewise.
* java/lang/UnsupportedClassVersionError.java: Likewise.
* java/lang/UnsupportedOperationException.java: Likewise.
* java/lang/VerifyError.java: Likewise.
* java/lang/VirtualMachineError.java: Likewise.
* java/lang/reflect/InvocationTargetException.java: Likewise.
* java/net/BindException.java: Likewise.
* java/net/ConnectException.java: Likewise.
* java/net/MalformedURLException.java: Likewise.
* java/net/NoRouteToHostException.java: Likewise.
* java/net/ProtocolException.java: Likewise.
* java/net/SocketException.java: Likewise.
* java/net/UnknownHostException.java: Likewise.
* java/net/UnknownServiceException.java: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54656 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/lang/CharSequence.java')
-rw-r--r-- | libjava/java/lang/CharSequence.java | 76 |
1 files changed, 42 insertions, 34 deletions
diff --git a/libjava/java/lang/CharSequence.java b/libjava/java/lang/CharSequence.java index 880d725f0ae..d46bd9d3813 100644 --- a/libjava/java/lang/CharSequence.java +++ b/libjava/java/lang/CharSequence.java @@ -1,5 +1,5 @@ -/* java.lang.CharSequence -- Anything that has an indexed sequence of chars - Copyright (C) 2001 Free Software Foundation, Inc. +/* CharSequence.java -- Anything that has an indexed sequence of chars + Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -44,8 +44,8 @@ package java.lang; * <code>CharBuffer</code> to give a uniform way to get chars at a certain * index, the number of characters in the sequence and a subrange of the * chars. Indexes start at 0 and the last index is <code>length()-1</code>. - * <p> - * Even when classes implement this interface they are not always + * + * <p>Even when classes implement this interface they are not always * exchangeble because they might implement their compare, equals or hash * function differently. This means that in general one should not use a * <code>CharSequence</code> as keys in collections since two sequences @@ -54,38 +54,46 @@ package java.lang; * represented by different classes. * * @author Mark Wielaard (mark@klomp.org) - * * @since 1.4 + * @status updated to 1.4 */ +public interface CharSequence +{ + /** + * Returns the character at the given index. + * + * @param i the index to retrieve from + * @return the character at that location + * @throws IndexOutOfBoundsException if i < 0 || i >= length() - 1 + */ + char charAt(int i); -public interface CharSequence { - - /** - * Returns the character at the given index. - * - * @exception IndexOutOfBoundsException when <code>i < 0</code> or - * <code>i > length()-1</code>. - */ - char charAt(int i); - - /** - * Returns the length of the sequence. - */ - int length(); + /** + * Returns the length of the sequence. This is the number of 16-bit + * characters in the sequence, which may differ from the length of the + * underlying encoding. + * + * @return the sequence length + */ + int length(); - /** - * Returns a new <code>CharSequence</char> of the indicated range. - * - * @exception IndexOutOfBoundsException when <code>begin < 0</code>, - * <code>end < 0</code>, <code>end > length()</code> or - * <code>begin > end</code> - */ - CharSequence subSequence(int begin, int end); + /** + * Returns a new <code>CharSequence</char> of the indicated range. + * + * @param begin the start index (inclusive) + * @param end the end index (exclusive) + * @return a subsequence of this + * @throws IndexOutOfBoundsException if begin > end || begin < 0 || + * end > length() + */ + CharSequence subSequence(int begin, int end); - /** - * Returns the complete <code>CharSequence</code> as a <code>String</code>. - * Classes that implement this interface should return a <code>String</code> - * which contains only the characters in the sequence in the correct order. - */ - String toString(); + /** + * Returns the complete <code>CharSequence</code> as a <code>String</code>. + * Classes that implement this interface should return a <code>String</code> + * which contains only the characters in the sequence in the correct order. + * + * @return the character sequence as a String + */ + String toString(); } |