]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/engine/TextEntry.java
Fix issues noted by lint tools.
[Dictionary.git] / src / com / hughes / android / dictionary / engine / TextEntry.java
index 28376267bbb0f301343a223b450afc2dc6bcb7ca..22f0af2abcd7294dba9fe92cb495491a6b5126a8 100644 (file)
@@ -18,25 +18,26 @@ import com.hughes.util.raf.RAFListSerializer;
 import com.hughes.util.raf.RAFSerializable;
 import com.ibm.icu.text.Transliterator;
 
+import java.io.DataInput;
+import java.io.DataOutput;
 import java.io.IOException;
 import java.io.PrintStream;
-import java.io.RandomAccessFile;
 import java.util.List;
 import java.util.regex.Pattern;
 
 public class TextEntry extends AbstractEntry implements RAFSerializable<TextEntry> {
 
-    final String text;
+    private final String text;
 
-    public TextEntry(final Dictionary dictionary, final RandomAccessFile raf, final int index)
-            throws IOException {
+    private TextEntry(final Dictionary dictionary, final DataInput raf, final int index)
+    throws IOException {
         super(dictionary, raf, index);
         text = raf.readUTF();
-        throw new RuntimeException();
+        throw new RuntimeException("TextEntry constructor should be unreachable");
     }
 
     @Override
-    public void write(RandomAccessFile raf) throws IOException {
+    public void write(DataOutput raf) throws IOException {
         super.write(raf);
         raf.writeUTF(text);
     }
@@ -50,15 +51,15 @@ public class TextEntry extends AbstractEntry implements RAFSerializable<TextEntr
         }
 
         @Override
-        public TextEntry read(RandomAccessFile raf, final int index) throws IOException {
+        public TextEntry read(DataInput raf, final int index) throws IOException {
             return new TextEntry(dictionary, raf, index);
         }
 
         @Override
-        public void write(RandomAccessFile raf, TextEntry t) throws IOException {
+        public void write(DataOutput raf, TextEntry t) throws IOException {
             t.write(raf);
         }
-    };
+    }
 
     @Override
     public void addToDictionary(final Dictionary dictionary) {
@@ -74,12 +75,12 @@ public class TextEntry extends AbstractEntry implements RAFSerializable<TextEntr
 
     public static class Row extends RowBase {
 
-        Row(final RandomAccessFile raf, final int thisRowIndex,
-                final Index index) throws IOException {
-            super(raf, thisRowIndex, index);
+        Row(final DataInput raf, final int thisRowIndex,
+            final Index index, int extra) throws IOException {
+            super(raf, thisRowIndex, index, extra);
         }
 
-        public TextEntry getEntry() {
+        TextEntry getEntry() {
             return index.dict.textEntries.get(referenceIndex);
         }
 
@@ -95,8 +96,8 @@ public class TextEntry extends AbstractEntry implements RAFSerializable<TextEntr
 
         @Override
         public RowMatchType matches(final List<String> searchTokens,
-                final Pattern orderedMatchPattern, Transliterator normalizer,
-                boolean swapPairEntries) {
+                                    final Pattern orderedMatchPattern, Transliterator normalizer,
+                                    boolean swapPairEntries) {
             return null;
         }
     }