]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/engine/EntrySource.java
go
[Dictionary.git] / src / com / hughes / android / dictionary / engine / EntrySource.java
index f773f6096fe2b3b60223e3bf7d89e98e9797305b..914cf8f5f7578c34678d27a0c83eb6a673f03112 100644 (file)
@@ -1,8 +1,11 @@
 package com.hughes.android.dictionary.engine;
 
+import java.io.IOException;
+import java.io.RandomAccessFile;
 import java.io.Serializable;
 
 import com.hughes.util.IndexedObject;
+import com.hughes.util.raf.RAFListSerializer;
 
 public class EntrySource extends IndexedObject implements Serializable {
   
@@ -10,8 +13,25 @@ public class EntrySource extends IndexedObject implements Serializable {
   
   final String name;
   
-  public EntrySource(final String name) {
+  public EntrySource(final int index, final String name) {
+    super(index);
     this.name = name;
   }
   
+  public static RAFListSerializer<EntrySource> SERIALIZER = new RAFListSerializer<EntrySource>() {
+
+    @Override
+    public EntrySource read(RandomAccessFile raf, int readIndex)
+        throws IOException {
+      final String name = raf.readUTF();
+      return new EntrySource(readIndex, name);
+    }
+
+    @Override
+    public void write(RandomAccessFile raf, EntrySource t) throws IOException {
+      raf.writeUTF(t.name);
+    }
+    
+  };
+  
 }