public IZyEditableObject getLineFragmentObjectAt(final int xPos) {
    for (final IZyEditableObject object : m_lineObjects) {
      if ((xPos >= object.getStart()) && (xPos < (object.getStart() + object.getLength()))) {
        return object;
      }
    }

    // if caret is directly behind an editable object
    for (final IZyEditableObject object : m_lineObjects) {
      if ((xPos >= object.getStart()) && ((xPos - 1) < (object.getStart() + object.getLength()))) {
        return object;
      }
    }

    return null;
  }
Returns the {@link IZyEditableObject} at the position given as argument or the {@link
IZyEditableObject} at the position + 1 if at position there was no object.

@param xPos to position to look for the {@link IZyEditableObject} at.
@return The {@link IZyEditableObject} if found else null.
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/zygraph/realizers/ZyLineContent.java