aboutsummaryrefslogtreecommitdiffstats
path: root/examples/hyphenation
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2008-07-24 09:35:34 +0000
committerVincent Hennebert <vhennebert@apache.org>2008-07-24 09:35:34 +0000
commit92df262a0778ee539c849454be2810621dac1b7e (patch)
treed5be9359cbacb91dffcab6f1a6ecfe61e9db2c6b /examples/hyphenation
parent30e2ce5bee38cbc32758e0b65fa7f98f3db76baa (diff)
downloadxmlgraphics-fop-92df262a0778ee539c849454be2810621dac1b7e.tar.gz
xmlgraphics-fop-92df262a0778ee539c849454be2810621dac1b7e.zip
Fed up with all those trailing whitespaces. Let's remove them all (once... and for all?)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@679326 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'examples/hyphenation')
-rw-r--r--examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java42
-rw-r--r--examples/hyphenation/src/org/apache/fop/hyphenation/TernaryTreeAnalysis.java82
2 files changed, 62 insertions, 62 deletions
diff --git a/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java b/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java
index ccd86ab25..dc8e16202 100644
--- a/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java
+++ b/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java
@@ -33,15 +33,15 @@ import java.util.zip.ZipFile;
import java.util.zip.ZipEntry;
/**
- * This class provides some useful methods to print the structure of a HyphenationTree object
+ * This class provides some useful methods to print the structure of a HyphenationTree object
*/
public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
/**
- * The HyphenationTree object to analyse
+ * The HyphenationTree object to analyse
*/
protected HyphenationTree ht;
-
+
/**
* @param ht the HyphenationTree object
*/
@@ -49,7 +49,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
super(ht);
this.ht = ht;
}
-
+
/**
* Class representing a node of the HyphenationTree object
*/
@@ -65,7 +65,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
value = readValue().toString();
}
}
-
+
private StringBuffer readValue() {
StringBuffer s = new StringBuffer();
int i = (int) ht.eq[index];
@@ -100,7 +100,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
return super.toNodeString();
}
}
-
+
/* (non-Javadoc)
* @see org.apache.fop.hyphenation.TernaryTreeAnalysis.Node#toCompactString()
*/
@@ -118,7 +118,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
return super.toCompactString();
}
}
-
+
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@@ -130,7 +130,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
}
return s.toString();
}
-
+
}
private void addNode(int nodeIndex, List strings, NodeString ns) {
@@ -182,7 +182,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
}
tree.append(indentString);
tree.append(ns.string + "\n");
-
+
if (i + 1 == strings.size()) {
continue;
}
@@ -199,10 +199,10 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
}
tree.append(indentString + "\n");
}
-
+
return tree.toString();
}
-
+
/**
* Construct the tree representation of the HyphenationTree object
* @return the string representing the tree
@@ -214,7 +214,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
addNode(1, strings, ns);
return toTree(strings);
}
-
+
/**
* Construct the compact node representation of the HyphenationTree object
* @return the string representing the tree
@@ -229,7 +229,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
}
return s.toString();
}
-
+
/**
* Construct the node representation of the HyphenationTree object
* @return the string representing the tree
@@ -244,17 +244,17 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
}
return s.toString();
}
-
+
/**
* Construct the printed representation of the HyphenationTree object
* @return the string representing the tree
*/
public String toString() {
StringBuffer s = new StringBuffer();
-
+
s.append("classes: \n");
s.append((new TernaryTreeAnalysis(ht.classmap)).toString());
-
+
s.append("\npatterns: \n");
s.append(super.toString());
s.append("vspace: ");
@@ -275,12 +275,12 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
}
}
s.append("\n");
-
+
return s.toString();
}
/**
- * Provide interactive access to a HyphenationTree object and its representation methods
+ * Provide interactive access to a HyphenationTree object and its representation methods
* @param args the arguments
*/
public static void main(String[] args) {
@@ -327,7 +327,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
System.out.print("Object file name: ");
token = in.readLine().trim();
try {
- String[] parts = token.split(":");
+ String[] parts = token.split(":");
InputStream is = null;
if (parts.length == 1) {
is = new FileInputStream(token);
@@ -399,7 +399,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
try {
BufferedReader reader = new BufferedReader(new FileReader(token));
String line;
-
+
starttime = System.currentTimeMillis();
while ((line = reader.readLine()) != null) {
// System.out.print("\nline: ");
@@ -422,7 +422,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
long result = endtime - starttime;
System.out.println(counter + " words in " + result
+ " Milliseconds hyphenated");
-
+
} else if (token.equals("q")) {
break;
}
diff --git a/examples/hyphenation/src/org/apache/fop/hyphenation/TernaryTreeAnalysis.java b/examples/hyphenation/src/org/apache/fop/hyphenation/TernaryTreeAnalysis.java
index 9ac6ff804..a783716a5 100644
--- a/examples/hyphenation/src/org/apache/fop/hyphenation/TernaryTreeAnalysis.java
+++ b/examples/hyphenation/src/org/apache/fop/hyphenation/TernaryTreeAnalysis.java
@@ -23,15 +23,15 @@ import java.util.ArrayList;
import java.util.List;
/**
- * This class provides some useful methods to print the structure of a TernaryTree object
+ * This class provides some useful methods to print the structure of a TernaryTree object
*/
public class TernaryTreeAnalysis {
/**
- * The TernaryTree object to analyse
+ * The TernaryTree object to analyse
*/
protected TernaryTree tt;
-
+
/**
* @param tt the TernaryTree object
*/
@@ -43,27 +43,27 @@ public class TernaryTreeAnalysis {
* Class representing a string of nodes in the tree representation of a TernaryTree
*/
public static class NodeString {
-
+
/**
- * The node string being constructed
+ * The node string being constructed
*/
public StringBuffer string = new StringBuffer();
-
+
/**
- * The indent of the node string
+ * The indent of the node string
*/
public int indent;
-
+
/**
- * The list of branchpoints into the high direction
+ * The list of branchpoints into the high direction
*/
public List high = new ArrayList();
-
+
/**
- * The list of branchpoints into the low direction
+ * The list of branchpoints into the low direction
*/
public List low = new ArrayList();
-
+
/**
* @param indent the indent of the nodestring
*/
@@ -78,34 +78,34 @@ public class TernaryTreeAnalysis {
* Class representing a node of the TernaryTree object
*/
protected class Node {
-
+
/**
- * The index of the node
+ * The index of the node
*/
protected int index = 0;
-
+
/**
- * The index of the high node
+ * The index of the high node
*/
protected int high = 0;
-
+
/**
- * The index of the high node
+ * The index of the high node
*/
protected int low = 0;
-
+
/**
- * The index of the equal node
+ * The index of the equal node
*/
protected int equal = 0;
-
+
/**
- * The key following the node
+ * The key following the node
*/
protected String key = null;
-
+
/**
- * True if this is a leaf node
+ * True if this is a leaf node
*/
protected boolean isLeafNode = false;
@@ -132,7 +132,7 @@ public class TernaryTreeAnalysis {
equal = tt.eq[index];
}
}
-
+
private StringBuffer readKey() {
StringBuffer s = new StringBuffer();
int i = (int) tt.lo[index];
@@ -160,7 +160,7 @@ public class TernaryTreeAnalysis {
}
return s.toString();
}
-
+
/**
* Construct the compact string representation of the node
* @return the string representing the node
@@ -184,7 +184,7 @@ public class TernaryTreeAnalysis {
}
return s.toString();
}
-
+
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@@ -204,9 +204,9 @@ public class TernaryTreeAnalysis {
}
return s.toString();
}
-
+
}
-
+
/**
* Construct the compact node representation of the TernaryTree object
* @return the string representing the tree
@@ -221,7 +221,7 @@ public class TernaryTreeAnalysis {
}
return s.toString();
}
-
+
/**
* Construct the node representation of the TernaryTree object
* @return the string representing the tree
@@ -236,7 +236,7 @@ public class TernaryTreeAnalysis {
}
return s.toString();
}
-
+
private static StringBuffer toString(char[] c) {
StringBuffer s = new StringBuffer();
for (int i = 0; i < c.length; ++i) {
@@ -244,8 +244,8 @@ public class TernaryTreeAnalysis {
s.append(",");
}
return s;
- }
-
+ }
+
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@@ -255,15 +255,15 @@ public class TernaryTreeAnalysis {
s.append("hi: ");
s.append(toString(tt.hi));
s.append("\n");
-
+
s.append("eq: ");
s.append(toString(tt.eq));
s.append("\n");
-
+
s.append("lo: ");
s.append(toString(tt.lo));
s.append("\n");
-
+
s.append("sc: ");
for (int i = 0; i < tt.sc.length; ++i) {
if (tt.sc[i] == 0) {
@@ -275,7 +275,7 @@ public class TernaryTreeAnalysis {
}
}
s.append("\n");
-
+
s.append("kv: ");
for (int i = 0; i < tt.kv.length(); ++i) {
if (tt.kv.get(i) == 0) {
@@ -285,17 +285,17 @@ public class TernaryTreeAnalysis {
}
}
s.append("\n");
-
+
s.append("freenode: ");
s.append((int) tt.freenode);
s.append("\n");
-
+
s.append("root: ");
s.append((int) tt.root);
s.append("\n");
-
+
return s.toString();
}
-
+
}