CharSequence


CharSequence java.lang

Java 1.4

This interface defines a simple API for read-only access to sequences of characters . In the core platform it is implemented by the String , StringBuffer and java.nio.CharBuffer classes. charAt( ) returns the character at a specified position in the sequence. length( ) returns the number of characters in the sequence. subSequence( ) returns a CharSequence that consists of the characters starting at, and including, the specified start index, and continuing up to, but not including the specified end index. Finally, toString( ) returns a String version of the sequence.

Note that CharSequence implementations do not typically have interoperable equals( ) or hashCode( ) methods , and it is not usually possible to compare two CharSequence objects or use multiple sequences in a set or hashtable unless they are instances of the same implementing class.

 public interface  CharSequence  {  // Public Instance Methods  char  charAt  (int  index  );        int  length  ( );        CharSequence  subSequence  (int  start  , int  end  );        String  toString  ( );   } 

Implementations

String , StringBuffer , StringBuilder , java.nio.CharBuffer

Passed To

Too many methods to list.

Returned By

String.subSequence( ) , StringBuffer.subSequence( ) , java.nio.CharBuffer.subSequence( )



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net