Count the number of times each String entry is found in this list.
()
| 721 | |
| 722 | /** Count the number of times each String entry is found in this list. */ |
| 723 | public IntDict getTally() { |
| 724 | IntDict outgoing = new IntDict(); |
| 725 | for (int i = 0; i < count; i++) { |
| 726 | outgoing.increment(data[i]); |
| 727 | } |
| 728 | return outgoing; |
| 729 | } |
| 730 | |
| 731 | |
| 732 | /** Create a dictionary associating each entry in this list to its index. */ |