if (children.size() == 0)
for (int index = 0; index < children.length; ++index) { Element elem = children[index];  if ((elem.getStartOffset() <= offset) && (offset < elem.getEndOffset())) return index; }
    public int getElementIndex(int offset)    {      if (children.size() == 0)	return 0;            Element element = positionToElement(offset);      if (element == null)	return 0;            return children.indexOf(element);    }