raf.writeShort(entrySource.index());
}
+ /**
+ * @return this entry's position within the list just added to.
+ */
public abstract int addToDictionary(final Dictionary dictionary);
+ public abstract RowBase CreateRow(int entryIndex, int rowIndex, Index dictionaryIndex);
+
}
public enum EntryTypeName {
+ WIKTIONARY_TITLE_SINGLE_DETAIL(true, true, null),
WIKTIONARY_TITLE_SINGLE(true, true, null),
WIKTIONARY_INFLECTD_FORM_SINGLE(false, true, null),
MULTIROW_HEAD_ONE_WORD(true, true, null),
MULTIROW_TAIL_ONE_WORD(false, true, null),
+ WIKTIONARY_TITLE_MULTI_DETAIL(false, true, WIKTIONARY_TITLE_SINGLE_DETAIL),
WIKTIONARY_TITLE_MULTI(false, true, WIKTIONARY_TITLE_SINGLE),
WIKTIONARY_TRANSLITERATION(),
WIKTIONARY_INFLECTED_FORM_MULTI(false, true, WIKTIONARY_INFLECTD_FORM_SINGLE),
final String title;
final String html;
+
+
+ public HtmlEntry(final EntrySource entrySource, String title, String html) {
+ super(entrySource);
+ this.title = title;
+ this.html = html;
+ }
+
public HtmlEntry(Dictionary dictionary, RandomAccessFile raf) throws IOException {
super(dictionary, raf);
title = raf.readUTF();
return dictionary.htmlEntries.size() - 1;
}
+ @Override
+ public RowBase CreateRow(int entryIndex, int rowIndex, Index dictionaryIndex) {
+ return new Row(entryIndex, rowIndex, dictionaryIndex);
+ }
+
+
static final class Serializer implements RAFSerializer<HtmlEntry> {
final Dictionary dictionary;
import java.util.List;
import java.util.regex.Pattern;
+import com.hughes.android.dictionary.engine.HtmlEntry.Row;
import com.hughes.util.raf.RAFSerializable;
import com.hughes.util.raf.RAFSerializer;
import com.ibm.icu.text.Transliterator;
return dictionary.pairEntries.size() - 1;
}
+ @Override
+ public RowBase CreateRow(int entryIndex, int rowIndex, Index dictionaryIndex) {
+ return new Row(entryIndex, rowIndex, dictionaryIndex);
+ }
+
// --------------------------------------------------------------------
import java.util.List;
import java.util.regex.Pattern;
+import com.hughes.android.dictionary.engine.HtmlEntry.Row;
import com.hughes.util.raf.RAFSerializable;
import com.hughes.util.raf.RAFSerializer;
import com.ibm.icu.text.Transliterator;
dictionary.textEntries.add(this);
return dictionary.textEntries.size() - 1;
}
+
+ @Override
+ public RowBase CreateRow(int entryIndex, int rowIndex, Index dictionaryIndex) {
+ throw new UnsupportedOperationException("TextEntry's don't really exist.");
+ }
public static class Row extends RowBase {