- };
-
-
- @Override
- public void addToDictionary(final Dictionary dictionary) {
- assert index == -1;
- dictionary.textEntries.add(this);
- index = dictionary.textEntries.size() - 1;
- }
-
- @Override
- public RowBase CreateRow(int rowIndex, Index dictionaryIndex) {
- throw new UnsupportedOperationException("TextEntry's don't really exist.");
- }
-
- public static class Row extends RowBase {
-
- Row(final RandomAccessFile raf, final int thisRowIndex,
- final Index index) throws IOException {
- super(raf, thisRowIndex, index);
- }
-
- public TextEntry getEntry() {
- return index.dict.textEntries.get(referenceIndex);
- }
-
- @Override
- public void print(PrintStream out) {
- out.println(" " + getEntry().text);
+
+ static final class Serializer implements RAFListSerializer<TextEntry> {
+
+ final Dictionary dictionary;
+
+ Serializer(Dictionary dictionary) {
+ this.dictionary = dictionary;
+ }
+
+ @Override
+ public TextEntry read(DataInput raf, final int index) throws IOException {
+ return new TextEntry(dictionary, raf, index);
+ }
+
+ @Override
+ public void write(DataOutput raf, TextEntry t) throws IOException {
+ t.write(raf);
+ }