Пример #1
0
  /**
   * Retrieves the final Object that satisfies the entire GuiObjectVector recognition string.
   *
   * @return valid Object if the recognition string was entirely satisfied.<br>
   *     null if it was not.
   */
  public Object getMatchedGuiObject() {

    int matchCount = matches.size();

    if (!hasFinalMatch) {
      // we will need to add code to resolve when multiple possible matches
      // exist but none were found to be "showing".  This is usually only
      // the case for items found by Index.
      // If only 1 match exists, we will use it, though.
      if (matchCount == 0) {
        Log.debug("GCI: No matching Object was found.");
        return null;
      }

      if (matchCount > 1) {
        Log.debug("Could not resolve multiple matches for the recognition string!");
        return null;
      }
      // fall out if matchCount == 1
    }

    MatchData match = (MatchData) matches.lastElement();
    return match.getGuiTestObject();
  }