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);
}
}
@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);
}
}
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);
}
@Override
public RowMatchType matches(final List<String> searchTokens,
- final Pattern orderedMatchPattern, Transliterator normalizer,
- boolean swapPairEntries) {
+ final Pattern orderedMatchPattern, Transliterator normalizer,
+ boolean swapPairEntries) {
return null;
}
}