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