// returns a string will all values from list public String toString() { String output = ""; HistoNode toCopy = front; while (toCopy.getNext() != null) { output += toCopy.getLetter() + " - " + toCopy.getLetterCount() + " "; toCopy = toCopy.getNext(); } return output; }
// returns the index pos of let in the list if let exists public int indexOf(char let) { int count = 0; HistoNode copy = front; while (copy != null) { if (copy.getLetter() == let) { return count; } else { copy = copy.getNext(); count++; } } return -1; }