Count the number of times each String entry is found in this list.
()
| 740 | |
| 741 | /** Count the number of times each String entry is found in this list. */ |
| 742 | public IntDict getTally() { |
| 743 | IntDict outgoing = new IntDict(); |
| 744 | for (int i = 0; i < count; i++) { |
| 745 | outgoing.increment(data[i]); |
| 746 | } |
| 747 | return outgoing; |
| 748 | } |
| 749 | |
| 750 | |
| 751 | /** Create a dictionary associating each entry in this list to its index. */ |