classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: java.nio.CharBuffer should implement java.lang.CharSequence


From: Michael Koch
Subject: Re: java.nio.CharBuffer should implement java.lang.CharSequence
Date: Fri, 22 Nov 2002 14:11:06 +0100
User-agent: KMail/1.4.7

Am Freitag, 22. November 2002 10:48 schrieb Ito Kazumitsu:
> I would like the following JDK 1.4 features to be added to
> classpath.   Thank you.
>
> --- java/nio/CharBuffer.java.orig     Fri Nov 22 18:33:15 2002
> +++ java/nio/CharBuffer.java  Fri Nov 22 18:37:27 2002
> @@ -42,7 +42,7 @@
>  /**
>   * @since 1.4
>   */
> -public abstract class CharBuffer extends Buffer
> +public abstract class CharBuffer extends Buffer implements
> CharSequence {
>    private ByteOrder endian = ByteOrder.BIG_ENDIAN;
>
>
>
> --- gnu/java/nio/CharBufferImpl.java.orig     Fri Nov 22 18:34:47 2002
> +++ gnu/java/nio/CharBufferImpl.java  Fri Nov 22 18:42:19 2002
> @@ -170,4 +170,19 @@
>
>      return super.toString();
>    }
> +
> +  // There must be a better way of doing the following.
> +  public CharSequence subSequence(int start, int end)
> +  {
> +      return toString().substring(start, end);
> +  }
> +  public int length()
> +  {
> +      return toString().length();
> +  }
> +  public char charAt(int i)
> +  {
> +      return toString().charAt(i);
> +  }
> +
>  }

Hello Ito,

I commited the attached patch to classpath. More changes are on my 
hard disk and will go in slowly.

Michael
-- 
Homepage: http://www.worldforge.org/
GPG-key: http://konqueror.dyndns.org/~mkoch/michael.gpg

Attachment: classpath-java-nio-Charbuffer.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]