Example #1
0
  /**
   * Takes the contents of the text area and breaks them into an array with an entry for each line
   * in the text area. Blank lines are removed but no other processing is performed.
   *
   * @return The lines found in text area. Blank lines are removed. Null is returned if the text
   *     area is empty.
   */
  public String[] getStrings() {
    String field_contents = text_area.getText();
    if (field_contents == null) return null;
    if (field_contents.equals("")) return null;

    String[] search_strings =
        mckay.utilities.staticlibraries.StringMethods.breakIntoTokens(field_contents, "\n");
    if (search_strings.length == 0) return null;

    return search_strings;
  }
Example #2
0
  /**
   * Takes the contents of the text area and breaks them into an array with an entry for each line
   * in the text area. Blank lines are removed, duplicate entries are removed and the remaining
   * lines are sorted alphabetically.
   *
   * @return The processed contents of the text area. Null is returned if text_area is empty.
   */
  public String[] getProcessedStrings() {
    // Get the contents of text_area with blank lines removed
    String[] uncleaned_strings = getStrings();

    if (uncleaned_strings != null) {
      // Remove duplicate strings
      String[] duplicate_removed_strings =
          mckay.utilities.staticlibraries.StringMethods.removeDoubles(uncleaned_strings);

      // Alphabetically sort the strings
      String[] sorted_strings =
          mckay.utilities.staticlibraries.SortingMethods.sortArray(duplicate_removed_strings);

      // Return the results
      return sorted_strings;
    } else return null;
  }