CharSequence类
2016-03-16 20:46
483 查看
CharSequence是char类型的一个可读序列,它本身是一个接口,CharBuffer、String、StringBuffer、StringBuilder这个四个类
实现了这个接口。此接口对于不同种类的char序列提供统一的只读访问
以下是这个函数的API 它只定义了四个方法
实现了这个接口。此接口对于不同种类的char序列提供统一的只读访问
以下是这个函数的API 它只定义了四个方法
/** * This interface represents an ordered set of characters and defines the * methods to probe them. */ public interface CharSequence { /** * Returns the number of characters in this sequence. * * @return the number of characters. */ public int length(); /** * Returns the character at the specified index, with the first character * having index zero. * * @param index * the index of the character to return. * @return the requested character. * @throws IndexOutOfBoundsException * if {@code index < 0} or {@code index} is greater than the * length of this sequence. */ public char charAt(int index); /** * Returns a {@code CharSequence} from the {@code start} index (inclusive) * to the {@code end} index (exclusive) of this sequence. * * @param start * the start offset of the sub-sequence. It is inclusive, that * is, the index of the first character that is included in the * sub-sequence. * @param end * the end offset of the sub-sequence. It is exclusive, that is, * the index of the first character after those that are included * in the sub-sequence * @return the requested sub-sequence. * @throws IndexOutOfBoundsException * if {@code start < 0}, {@code end < 0}, {@code start > end}, * or if {@code start} or {@code end} are greater than the * length of this sequence. */ public CharSequence subSequence(int start, int end); /** * Returns a string with the same characters in the same order as in this * sequence. * * @return a string based on this sequence. */ public String toString(); }
相关文章推荐
- Volley源码学习(三):线程处理request,类CacheDispatcher,NetworkDispatcher,ExecutorDelivery
- iOS UIView animation动画效果 (1)
- easyui 列表里下拉框联动
- UI进阶——SQL数据库
- android:finishOnTaskLaunch="true" //虽然这样设置了,但是Back键与Home键还是不同
- torque
- 给UIButton设置BackgroundColor:forState
- guice框架的入门使用
- (4.5.3.4)finished with non-zero exit value 2
- UI组件:PopupWindows的详细使用(一)
- U3D打包DLL插件 DLL Builder
- UITableView传值(自己使用)(属性,代理传值)
- iOS UITextField设置金额(钱数)输入框
- iOS--页面跳转(UITableView)
- NGUI中打字效果TypewriterEffect的一个BUG
- POJ 2229 Ultra-QuickSort 归并排序求逆序数
- Number Sequence (HDU_1711) KMP
- build模式小例子
- [ShareSDK] QuickIntegrater.jar文件各种打不开
- UITextField - 解决键盘遮住View & 密文设定 & 实例