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: Brian Jones
Subject: Re: java.nio.CharBuffer should implement java.lang.CharSequence
Date: 22 Nov 2002 10:18:43 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Michael Koch <address@hidden> writes:

> > --- 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);
> > +  }
> > +
> >  }

Doesn't this make it difficult to have a char buffer greater than the
maximum length of String?  Is this what the API recommends?
-- 
Brian Jones <address@hidden>
http://www.haphazard.org/~cbj/




reply via email to

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