]> gitweb.fperrin.net Git - Dictionary.git/blob - src/com/hughes/android/dictionary/engine/Dictionary.java
go
[Dictionary.git] / src / com / hughes / android / dictionary / engine / Dictionary.java
1 package com.hughes.android.dictionary.engine;
2
3 import java.io.IOException;
4 import java.io.RandomAccessFile;
5 import java.util.List;
6
7 import com.hughes.util.raf.RAFSerializable;
8
9 public class Dictionary {
10   
11   // persisted
12   List<PairEntry> pairEntries;
13   
14   // persisted
15   List<EntrySource> sources;
16
17   // --------------------------------------------------------------------------
18   
19   final class Index {
20     // One big list!
21     // Various sub-types.
22     // persisted
23     List<Row> rows;
24     
25     // persisted
26     List<IndexEntry> sortedIndexEntries;
27     
28     Dictionary getDict() {
29       return Dictionary.this;
30     }
31   }
32
33   static final class IndexEntry implements RAFSerializable<IndexEntry> {
34     String token;
35     int startRow;
36     
37     public void write(RandomAccessFile raf) throws IOException {
38       raf.writeUTF(token);
39       raf.write(startRow);
40     }
41   }
42
43   
44 }