]> gitweb.fperrin.net Git - Dictionary.git/blob - src/com/hughes/android/dictionary/Entry.java
go
[Dictionary.git] / src / com / hughes / android / dictionary / Entry.java
1 package com.hughes.android.dictionary;
2
3 import java.io.IOException;
4 import java.io.RandomAccessFile;
5
6 import com.hughes.util.raf.RAFFactory;
7 import com.hughes.util.raf.RAFSerializable;
8
9 public abstract class Entry implements RAFSerializable<Entry> {
10   
11   public static final RAFFactory<Entry> RAF_FACTORY = new RAFFactory<Entry>() {
12     public Entry create(RandomAccessFile raf) throws IOException {
13       final byte type = raf.readByte();
14       switch (type) {
15       case 0:
16         return SimpleEntry.RAF_FACTORY.create(raf);
17       }
18       throw new RuntimeException("Invalid entry type: " + type);
19     }};
20     
21   
22 }