Revision: 12396
http://sourceforge.net/p/foray/code/12396
Author: victormote
Date: 2022-01-14 14:12:59 +0000 (Fri, 14 Jan 2022)
Log Message:
-----------
Rename instance variable for clarity.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java 2022-01-14 13:55:19 UTC (rev 12395)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoTextWords4a.java 2022-01-14 14:12:59 UTC (rev 12396)
@@ -41,7 +41,8 @@
import org.axsl.orthography.Whitespace;
/**
- * Text in an FO document that is already broken into words.
+ * Text in an FO document that has been tokenized into words.
+ * This is a thin wrapper around an instance of {@link FoTokenFlow} that allows that token flow to live in an FO tree.
*/
public class FoTextWords4a extends FoText4a implements FoTextWords {
@@ -49,7 +50,7 @@
private FoObj parent;
/** The parsed words. */
- private FoTokenFlow paraBranch;
+ private FoTokenFlow tokenFlow;
/**
* Constructor.
@@ -62,7 +63,7 @@
this.parent = parent;
final FoOrthographyServer orthographyServer = getOrthographyServer();
final FoOrthography orthography = orthographyServer.getOrthography(getWritingSystem());
- this.paraBranch = orthography.tokenize(content, 0, content.length());
+ this.tokenFlow = orthography.tokenize(content, 0, content.length());
}
@Override
@@ -72,8 +73,8 @@
@Override
public boolean isAllWhiteSpace() {
- for (int index = 0; index < this.paraBranch.qtyTokens(); index ++) {
- final FoToken token = this.paraBranch.tokenAt(index);
+ for (int index = 0; index < this.tokenFlow.qtyTokens(); index ++) {
+ final FoToken token = this.tokenFlow.tokenAt(index);
if (! (token instanceof Whitespace)) {
return false;
}
@@ -92,8 +93,8 @@
*/
public CharSequence getRawText() {
final StringBuilder builder = new StringBuilder();
- for (int nodeIndex = 0; nodeIndex < this.paraBranch.qtyTokens(); nodeIndex ++) {
- final ParaNode node = this.paraBranch.paraNodeAt(nodeIndex);
+ for (int nodeIndex = 0; nodeIndex < this.tokenFlow.qtyTokens(); nodeIndex ++) {
+ final ParaNode node = this.tokenFlow.paraNodeAt(nodeIndex);
builder.append(node.getText());
}
return builder.toString();
@@ -106,7 +107,7 @@
@Override
public FoTokenFlow getFoTokenFlow() {
- return this.paraBranch;
+ return this.tokenFlow;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|