package com.hughes.android.dictionary.engine; import java.io.IOException; import java.io.RandomAccessFile; import java.util.List; import com.hughes.util.raf.RAFSerializable; public class Dictionary { // persisted List pairEntries; // persisted List sources; // -------------------------------------------------------------------------- final class Index { // One big list! // Various sub-types. // persisted List rows; // persisted List sortedIndexEntries; Dictionary getDict() { return Dictionary.this; } } static final class IndexEntry implements RAFSerializable { String token; int startRow; public void write(RandomAccessFile raf) throws IOException { raf.writeUTF(token); raf.write(startRow); } } }