001: /*
002: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
003: * notice. All rights reserved.
004: */
005: package com.tctest.stringbuffer;
006:
007: // An interface to allow StringBufferTest to interact with both java.lang.StringBuilder
008: // and java.lang.StringBuffer as equals
009: public interface StringBuddy {
010: Object append(boolean b);
011:
012: Object append(char c);
013:
014: Object append(char[] str, int offset, int len);
015:
016: Object append(char[] str);
017:
018: Object append(CharSequence s, int start, int end);
019:
020: Object append(CharSequence s);
021:
022: Object append(double d);
023:
024: Object append(float f);
025:
026: Object append(int i);
027:
028: Object append(long lng);
029:
030: Object append(String str);
031:
032: Object append(Object sb);
033:
034: Object appendCodePoint(int codePoint);
035:
036: public int capacity();
037:
038: public char charAt(int index);
039:
040: public int codePointAt(int index);
041:
042: public int codePointBefore(int index);
043:
044: public int codePointCount(int beginIndex, int endIndex);
045:
046: Object delete(int start, int end);
047:
048: Object deleteCharAt(int index);
049:
050: public void ensureCapacity(int minimumCapacity);
051:
052: public void getChars(int srcBegin, int srcEnd, char[] dst,
053: int dstBegin);
054:
055: public int indexOf(String str, int fromIndex);
056:
057: public int indexOf(String str);
058:
059: Object insert(int offset, boolean b);
060:
061: Object insert(int offset, char c);
062:
063: Object insert(int index, char[] str, int offset, int len);
064:
065: Object insert(int offset, char[] str);
066:
067: Object insert(int dstOffset, CharSequence s, int start, int end);
068:
069: Object insert(int dstOffset, CharSequence s);
070:
071: Object insert(int offset, double d);
072:
073: Object insert(int offset, float f);
074:
075: Object insert(int offset, int i);
076:
077: Object insert(int offset, long l);
078:
079: Object insert(int offset, Object obj);
080:
081: Object insert(int offset, String str);
082:
083: public int lastIndexOf(String str, int fromIndex);
084:
085: public int lastIndexOf(String str);
086:
087: public int length();
088:
089: public int offsetByCodePoints(int index, int codePointOffset);
090:
091: Object replace(int start, int end, String str);
092:
093: Object reverse();
094:
095: public void setCharAt(int index, char ch);
096:
097: public void setLength(int newLength);
098:
099: public CharSequence subSequence(int start, int end);
100:
101: public String substring(int start, int end);
102:
103: public String substring(int start);
104:
105: public void trimToSize();
106: }
|