/** * Wrapper of {@link String#contains(CharSequence)} * * @param s the char sequence to be found * @return {@code true} if {@code s} has been found */ @Override public boolean contains(CharSequence s) { if (s instanceof FastStr) { return indexOf((FastStr) s) > -1; } return indexOf(s.toString()) > -1; }
/** * Wrapper of {@link String#contains(CharSequence)} * * @param s the char sequence to be found * @return {@code true} if {@code s} has been found */ @Override public boolean contains(CharSequence s) { if (s instanceof FastStr) { return indexOf((FastStr) s) > -1; } return indexOf(s.toString()) > -1; }
public FastStr beforeFirst(FastStr s) { int pos = indexOf(s); if (pos < 0) return EMPTY_STR; return substr(0, pos); }
@Override public FastStr afterFirst(char c) { int pos = indexOf(c); if (pos < 0) return EMPTY_STR; return substr(pos + 1); }
public FastStr beforeFirst(FastStr s) { int pos = indexOf(s); if (pos < 0) return EMPTY_STR; return substr(0, pos); }
@Override public FastStr afterFirst(char c) { int pos = indexOf(c); if (pos < 0) return EMPTY_STR; return substr(pos + 1); }
@Override public FastStr beforeFirst(char c) { int pos = indexOf(c); if (pos < 0) return EMPTY_STR; return substr(0, pos); }
@Override public FastStr beforeFirst(char c) { int pos = indexOf(c); if (pos < 0) return EMPTY_STR; return substr(0, pos); }
@Override public FastStr afterFirst(FastStr s) { int pos = indexOf(s); if (pos < 0) return EMPTY_STR; return substr(pos + s.size()); }
@Override public FastStr afterFirst(FastStr s) { int pos = indexOf(s); if (pos < 0) return EMPTY_STR; return substr(pos + s.size()); }
@Override public boolean apply(JSONSerializer serializer, Object source, String name) { if (source == null) { return true; } // if context path is "$.bar.zee" or "$[0].bar.zee" and name is "foo" // then path should be "bar.zee.foo" String path; FastStr fs = FastStr.of(serializer.getContext().toString()).append('.').append(name); path = fs.substring(fs.indexOf('.') + 1); // skip the first "." return matches(path); }
@Override public boolean apply(JSONSerializer serializer, Object source, String name) { if (source == null) { return true; } // if context path is "$.bar.zee" or "$[0].bar.zee" and name is "foo" // then path should be "bar.zee.foo" String path; FastStr fs = FastStr.of(serializer.getContext().toString()).append('.').append(name); path = fs.substring(fs.indexOf('.') + 1); // skip the first "." return matches(path); }
boolean limited = limit > 0; C.List<FastStr> list = C.newList(); while ((next = indexOf(ch, off)) != -1) { if (!limited || list.size() < limit - 1) { list.add(substr(off, next));
boolean limited = limit > 0; C.List<FastStr> list = C.newList(); while ((next = indexOf(ch, off)) != -1) { if (!limited || list.size() < limit - 1) { list.add(substr(off, next));