@Override public String getStringValue() { String res = ""; for (ComponentOfWord componentOfWord : components) { res += componentOfWord.getValue(); } return res; }
/** Deletes all subsequent occurrences of the word the first letter of the word. */ public void removeFirstOccurrence() { if (components.size() != 0) { char first = components.get(0).getValue(); int i = 1; ComponentOfWord componentOfWord; while (i < components.size()) { componentOfWord = components.get(i); if (componentOfWord.getValue() == first) { components.remove(i); } else { i++; } } } }