import java.io.IOException;
import java.io.PrintStream;
import java.io.RandomAccessFile;
+import java.util.List;
import com.hughes.util.IndexedObject;
import com.hughes.util.raf.RAFListSerializer;
+import com.ibm.icu.text.Transliterator;
public abstract class RowBase extends IndexedObject {
/**
public abstract void print(PrintStream out);
public abstract String getRawText(final boolean compact);
+
+ public abstract RowMatchType matches(final List<String> searchTokens, final Transliterator normalizer, boolean swapPairEntries);
// RowBase must manage "disk-based" polymorphism. All other polymorphism is
// dealt with in the normal manner.
final byte rowType = raf.readByte();
if (rowType == 0) {
return new PairEntry.Row(raf, listIndex, index);
- } else if (rowType == 1) {
- return new TokenRow(raf, listIndex, index);
+ } else if (rowType == 1 || rowType == 3) {
+ return new TokenRow(raf, listIndex, index, rowType == 1);
} else if (rowType == 2) {
return new TextEntry.Row(raf, listIndex, index);
}
if (t instanceof PairEntry.Row) {
raf.writeByte(0);
} else if (t instanceof TokenRow) {
- raf.writeByte(1);
+ final TokenRow tokenRow = (TokenRow) t;
+ raf.writeByte(tokenRow.hasMainEntry ? 1 : 3);
} else if (t instanceof TextEntry.Row) {
raf.writeByte(2);
}
raf.writeInt(t.referenceIndex);
}
}
-
+
}