[FOray-commit] SF.net SVN: foray:[10655] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2009-03-12 18:38:30
|
Revision: 10655
http://foray.svn.sourceforge.net/foray/?rev=10655&view=rev
Author: victormote
Date: 2009-03-12 18:38:16 +0000 (Thu, 12 Mar 2009)
Log Message:
-----------
Now that we don't have to zero-terminate the vector, leave the zeros alone, and store all values with their native value.
Modified Paths:
--------------
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/HyphenationTree.java
trunk/foray/lib/foray-hyphen-0.4-rsrc.jar
Modified: trunk/foray/foray-hyphen/src/java/org/foray/hyphen/HyphenationTree.java
===================================================================
--- trunk/foray/foray-hyphen/src/java/org/foray/hyphen/HyphenationTree.java 2009-03-12 18:25:16 UTC (rev 10654)
+++ trunk/foray/foray-hyphen/src/java/org/foray/hyphen/HyphenationTree.java 2009-03-12 18:38:16 UTC (rev 10655)
@@ -33,10 +33,10 @@
package org.foray.hyphen;
+import org.foray.common.Bit;
import org.foray.common.ByteVectorPacked;
import org.foray.common.CharVector;
import org.foray.common.StringUtil;
-import org.foray.common.WKConstants;
import org.axsl.hyphen.HyphenationException;
@@ -163,8 +163,11 @@
private int packValues(final String values) {
final int start = this.patternValues.length();
for (int stringIndex = 0; stringIndex < values.length(); stringIndex++) {
- final byte packedValue = (byte) ((values.charAt(stringIndex)
- - '0' + 1) & WKConstants.MAX_4_BIT_UNSIGNED_BYTE);
+ /* Convert an ASCII numeral to its numeric value. For example, an ASCII numeral 0 (0x30)
+ * converts to 0x00. */
+ final byte rawValue = (byte) (values.charAt(stringIndex) - '0');
+ /* Ensure that all high-order bits are gone. */
+ final byte packedValue = Bit.maskHighOrderBits(rawValue);
this.patternValues.add(packedValue);
}
/* Add the termination marker. */
@@ -213,7 +216,7 @@
int packedIndex = start;
byte packedValue = this.patternValues.get(packedIndex++);
while (packedValue != HyphenationTree.PATTERN_VALUES_TERMINATOR) {
- final char c = (char) (packedValue - 1);
+ final char c = (char) packedValue;
buf.append(c);
/* Load the next byte. */
Modified: trunk/foray/lib/foray-hyphen-0.4-rsrc.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|