]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/engine/RowBase.java
UI changes, (experiments), Arabic rendering changes, changing the way
[Dictionary.git] / src / com / hughes / android / dictionary / engine / RowBase.java
index 9104398bdf1675f806d17ae47a52d3ab7b4ab395..569fc000a0094007bfdd6a4500d17abcfb82fdca 100644 (file)
@@ -1,3 +1,17 @@
+// Copyright 2011 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
 package com.hughes.android.dictionary.engine;
 
 import java.io.IOException;
@@ -99,8 +113,10 @@ public abstract class RowBase extends IndexedObject {
       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);
       }
       throw new RuntimeException("Invalid rowType:" + rowType);
     }
@@ -110,7 +126,10 @@ public abstract class RowBase extends IndexedObject {
       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);
     }