站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

AbstractCharSequence (Editor Utilities) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.util/1 1.17

org.netbeans.lib.editor.util
Class AbstractCharSequence

java.lang.Object
  extended by org.netbeans.lib.editor.util.AbstractCharSequence
All Implemented Interfaces:
CharSequence
Direct Known Subclasses:
AbstractCharSequence.StringLike, CharSubSequence

public abstract class AbstractCharSequence
extends Object
implements CharSequence

Abstract implementation of character sequence with String-like implementation of hashCode() and equals().


Nested Class Summary
static class AbstractCharSequence.StringLike
          Subclass providing string-like implementation of hashCode() and equals() method accepting strings with the same content like charsequence has.
 
Constructor Summary
AbstractCharSequence()
           
 
Method Summary
abstract  char charAt(int index)
          Returns the character at the specified index.
abstract  int length()
          Returns the length of this character sequence.
 CharSequence subSequence(int start, int end)
          Return subsequence of this character sequence.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractCharSequence

public AbstractCharSequence()
Method Detail

length

public abstract int length()
Returns the length of this character sequence. The length is the number of 16-bit Unicode characters in the sequence.

Specified by:
length in interface CharSequence
Returns:
the number of characters in this sequence

charAt

public abstract char charAt(int index)
Returns the character at the specified index. An index ranges from zero to length() - 1. The first character of the sequence is at index zero, the next at index one, and so on, as for array indexing.

Specified by:
charAt in interface CharSequence
Parameters:
index - the index of the character to be returned
Returns:
the specified character
Throws:
IndexOutOfBoundsException - if the index argument is negative or not less than length()

subSequence

public CharSequence subSequence(int start,
                                int end)
Return subsequence of this character sequence. The returned character sequence is only as stable as is this character sequence.

Specified by:
subSequence in interface CharSequence
Parameters:
start - >=0 starting index of the subsequence within this character sequence.
end - >=0 ending index of the subsequence within this character sequence.

toString

public String toString()
Specified by:
toString in interface CharSequence
Overrides:
toString in class Object

org.netbeans.modules.editor.util/1 1.17

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.