if ((str.length() > 0) && (offset > 0)) throw new IllegalArgumentException("Offset too large: " + offset); else if (offset > (str.length() - 1))
if (offset > (text.length() - 1))
setOffset(int offset){  if (offset < 0)    throw new IllegalArgumentException("Negative offset: " + offset);  if ((str.length() > 0) && (offset > 0))    throw new IllegalArgumentException("Offset too large: " + offset);  else if (offset > (str.length() - 1))    throw new IllegalArgumentException("Offset too large: " + offset);  pos = offset;}    