@Test public void testSubSequence() { String s = "One two three"; byte[] data = s.getBytes(); Text t = new Text(); t.strain(data, 0, data.length); Text t2 = new Text(); t2.strain(data, 4, 3); CharSequence t1 = t.subSequence(4, 7); for (int i = 0; i < t1.length(); i++) { assertEquals(t2.charAt(i), t1.charAt(i)); } }
public CharSequence subSequence(int start, int end) { return subtext(start, end); }
Text implements CharSequence { public CharSequence subSequence(int start, int end) { return subtext(start, end); } }
Text implements CharSequence { public CharSequence subSequence(int start, int end) { return subtext(start, end); } Text(); protected  Text(Text another);  Text(String s);  Text(int i);  Text(byte[] data, int pos, int len); }
Text implements CharSequence { public CharSequence subSequence(int start, int end) { return subtext(start, end); } Text(); protected  Text(Text another);  Text(String s);  Text(int i);  Text(byte[] data, int pos, int len); void strain(byte[] data, int pos, int len); int length(); char charAt(int index); void copy(Text destination); void duplicate(Text destination); int divide(char separator, Text[] parts); int divide(char[] separators, Text[] parts); CharSequence subSequence(int start, int end); Text subtext(int start, int end); Text subtext(int start); Collection<Text> split(char separator); Collection<Text> split(Text separator); int indexOf(Text value); int indexOf(char value); void trim(); Text nextLine(); boolean hasMoreLines(); @Override boolean equals(Object other); @Override int hashCode(); boolean startsWith(Text pattern); @Override String toString(); int toInteger(); long toLong(); int hexToInteger(); void write(ByteBuffer buffer); void copyRemainder(Text other); boolean contains(char c); }
Text implements CharSequence { public CharSequence subSequence(int start, int end) { return subtext(start, end); } Text(); protected  Text(Text another);  Text(String s);  Text(int i);  Text(byte[] data, int pos, int len); void strain(byte[] data, int pos, int len); int length(); char charAt(int index); void copy(Text destination); void duplicate(Text destination); int divide(char separator, Text[] parts); int divide(char[] separators, Text[] parts); CharSequence subSequence(int start, int end); Text subtext(int start, int end); Text subtext(int start); Collection<Text> split(char separator); Collection<Text> split(Text separator); int indexOf(Text value); int indexOf(char value); void trim(); Text nextLine(); boolean hasMoreLines(); @Override boolean equals(Object other); @Override int hashCode(); boolean startsWith(Text pattern); @Override String toString(); int toInteger(); long toLong(); int hexToInteger(); void write(ByteBuffer buffer); void copyRemainder(Text other); boolean contains(char c);  }