From ed798fa30827ef623fc4ede381dd18cafb4cfd8d Mon Sep 17 00:00:00 2001 From: Keisuke Kuroyanagi Date: Thu, 21 Aug 2014 17:22:54 +0900 Subject: [PATCH] Remove unused dictionary writing methods. Change-Id: Ica6ac057c0d0f037b7dd5539ab5b591c83bfa4d7 --- .../makedict/BinaryDictEncoderUtils.java | 26 ------------------- .../latin/makedict/DictEncoder.java | 1 - .../latin/makedict/Ver2DictEncoder.java | 6 ----- .../latin/makedict/Ver4DictEncoder.java | 4 --- 4 files changed, 37 deletions(-) diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java index eabd8d722..2b3fd892a 100644 --- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java +++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java @@ -547,28 +547,6 @@ public class BinaryDictEncoderUtils { } } - /** - * Helper method to write a signed children position to a file. - * - * @param buffer the buffer to write to. - * @param index the index in the buffer to write the address to. - * @param position the position to write. - * @return the size in bytes the address actually took. - */ - /* package */ static int writeSignedChildrenPosition(final byte[] buffer, int index, - final int position) { - if (!BinaryDictIOUtils.hasChildrenAddress(position)) { - buffer[index] = buffer[index + 1] = buffer[index + 2] = 0; - } else { - final int absPosition = Math.abs(position); - buffer[index++] = - (byte)((position < 0 ? FormatSpec.MSB8 : 0) | (0xFF & (absPosition >> 16))); - buffer[index++] = (byte)(0xFF & (absPosition >> 8)); - buffer[index++] = (byte)(0xFF & absPosition); - } - return 3; - } - /** * Makes the flag value for a PtNode. * @@ -734,10 +712,6 @@ public class BinaryDictEncoderUtils { final int ptNodeCount = ptNodeArray.mData.size(); dictEncoder.writePtNodeCount(ptNodeCount); - final int parentPosition = - (ptNodeArray.mCachedParentAddress == FormatSpec.NO_PARENT_ADDRESS) - ? FormatSpec.NO_PARENT_ADDRESS - : ptNodeArray.mCachedParentAddress + ptNodeArray.mCachedAddressAfterUpdate; for (int i = 0; i < ptNodeCount; ++i) { final PtNode ptNode = ptNodeArray.mData.get(i); if (dictEncoder.getPosition() != ptNode.mCachedAddressAfterUpdate) { diff --git a/tests/src/com/android/inputmethod/latin/makedict/DictEncoder.java b/tests/src/com/android/inputmethod/latin/makedict/DictEncoder.java index 678c5ca6b..645fd5c02 100644 --- a/tests/src/com/android/inputmethod/latin/makedict/DictEncoder.java +++ b/tests/src/com/android/inputmethod/latin/makedict/DictEncoder.java @@ -33,6 +33,5 @@ public interface DictEncoder { public void setPosition(final int position); public int getPosition(); public void writePtNodeCount(final int ptNodeCount); - public void writeForwardLinkAddress(final int forwardLinkAddress); public void writePtNode(final PtNode ptNode, final FusionDictionary dict); } diff --git a/tests/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java b/tests/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java index a286190cb..a7693d5ab 100644 --- a/tests/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java +++ b/tests/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java @@ -222,12 +222,6 @@ public class Ver2DictEncoder implements DictEncoder { } } - @Override - public void writeForwardLinkAddress(final int forwardLinkAddress) { - mPosition = BinaryDictEncoderUtils.writeUIntToBuffer(mBuffer, mPosition, forwardLinkAddress, - FormatSpec.FORWARD_LINK_ADDRESS_SIZE); - } - @Override public void writePtNode(final PtNode ptNode, final FusionDictionary dict) { writePtNodeFlags(ptNode); diff --git a/tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java b/tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java index 76eaef431..2e5435159 100644 --- a/tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java +++ b/tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java @@ -140,10 +140,6 @@ public class Ver4DictEncoder implements DictEncoder { public void writePtNodeCount(int ptNodeCount) { } - @Override - public void writeForwardLinkAddress(int forwardLinkAddress) { - } - @Override public void writePtNode(PtNode ptNode, FusionDictionary dict) { }