- for (final Map.Entry<EntryTypeName, List<IndexedEntry>> typeToEntry : tokenData.typeToEntries.entrySet()) {
- for (final IndexedEntry entryData : typeToEntry.getValue()) {
- if (entryData.index() == -1) {
- entryData.addToDictionary(dictionaryBuilder.dictionary);
- assert entryData.index() >= 0;
+ for (final Map.Entry<EntryTypeName, List<IndexedEntry>> typeToIndexedEntries : tokenData.typeToEntries.entrySet()) {
+ for (final IndexedEntry indexedEntry : typeToIndexedEntries.getValue()) {
+ if (!indexedEntry.isValid) {
+ continue;
+ }
+
+ if (tokenRow == null) {
+ tokenRow = new TokenRow(indexIndex, rows.size(), index, tokenData.hasMainEntry);
+ rows.add(tokenRow);
+ }
+
+ if (indexedEntry.entry.index() == -1) {
+ indexedEntry.entry.addToDictionary(dictionaryBuilder.dictionary);
+ assert indexedEntry.entry.index() >= 0;