/** * {@inheritDoc} */ public AsciiSequenceView subSequence(final int start, final int end) { if (start < 0) { throw new StringIndexOutOfBoundsException("start=" + start); } if (end > length) { throw new StringIndexOutOfBoundsException("end=" + end); } if (end - start < 0) { throw new StringIndexOutOfBoundsException("start=" + start + " end=" + end); } return new AsciiSequenceView(buffer, offset + start, end - start); }
public static AsciiSequenceView getAsciiSequenceView(final Object value, final String name) throws Exception { final AsciiSequenceView view = new AsciiSequenceView(); value.getClass() .getMethod(name, AsciiSequenceView.class) .invoke(value, view); return view; } }
/** * {@inheritDoc} */ public AsciiSequenceView subSequence(final int start, final int end) { if (start < 0) { throw new StringIndexOutOfBoundsException("start=" + start); } if (end > length) { throw new StringIndexOutOfBoundsException("end=" + end); } if (end - start < 0) { throw new StringIndexOutOfBoundsException("start=" + start + " end=" + end); } return new AsciiSequenceView(buffer, offset + start, end - start); }