1 19 20 package org.netbeans.lib.editor.util; 21 22 30 31 public abstract class AbstractCharSequence implements CharSequence { 32 33 39 public abstract int length(); 40 41 55 public abstract char charAt(int index); 56 57 58 private String toString(int start, int end) { 59 return CharSequenceUtilities.toString(this, start, end); 60 } 61 62 72 public CharSequence subSequence(int start, int end) { 73 return new CharSubSequence(this, start, end); 74 } 75 76 public String toString() { 77 return toString(0, length()); 78 } 79 80 93 public static abstract class StringLike extends AbstractCharSequence { 94 95 public int hashCode() { 96 return CharSequenceUtilities.stringLikeHashCode(this); 97 } 98 99 public boolean equals(Object o) { 100 return CharSequenceUtilities.equals(this, o); 101 } 102 103 } 104 105 } 106 | Popular Tags |