public boolean regionMatches(boolean ignoreCase, int toffset, CharSequence other, int ooffset, int len ) { char[] otherBuf = bufOf(other); return regionMatches(ignoreCase, toffset, otherBuf, ooffset, len); }
@Override public int count(String search, boolean overlap) { char[] searchBuf = bufOf(search); return count(searchBuf, 0, searchBuf.length, overlap); }
/** * Construct a FastStr instance from a String instance. * The FastStr instance will share the char array buf with * the String instance * @param s the string instance * @return A FastStr instance */ public static FastStr unsafeOf(String s) { int sz = s.length(); if (sz == 0) return EMPTY_STR; char[] buf = bufOf(s); return new FastStr(buf, 0, sz); }
public boolean regionMatches(boolean ignoreCase, int toffset, CharSequence other, int ooffset, int len ) { char[] otherBuf = bufOf(other); return regionMatches(ignoreCase, toffset, otherBuf, ooffset, len); }
@Override public int count(String search, boolean overlap) { char[] searchBuf = bufOf(search); return count(searchBuf, 0, searchBuf.length, overlap); }
/** * Construct a FastStr instance from a String instance. * The FastStr instance will share the char array buf with * the String instance * @param s the string instance * @return A FastStr instance */ public static FastStr unsafeOf(String s) { int sz = s.length(); if (sz == 0) return EMPTY_STR; char[] buf = bufOf(s); return new FastStr(buf, 0, sz); }
@Override public int lastIndexOf(CharSequence str, int fromIndex) { char[] strBuf = bufOf(str); int sz = size(); return S.lastIndexOf(buf, begin, sz, strBuf, 0, strBuf.length, fromIndex); }
@Override public int indexOf(CharSequence str, int fromIndex) { char[] strBuf = bufOf(str); return S.indexOf(buf, begin, size(), strBuf, 0, strBuf.length, fromIndex); }
@Override public int lastIndexOf(CharSequence str, int fromIndex) { char[] strBuf = bufOf(str); int sz = size(); return S.lastIndexOf(buf, begin, sz, strBuf, 0, strBuf.length, fromIndex); }
@Override public int indexOf(CharSequence str, int fromIndex) { char[] strBuf = bufOf(str); return S.indexOf(buf, begin, size(), strBuf, 0, strBuf.length, fromIndex); }