]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Javadocs and toString() methods.
authorJeremias Maerki <jeremias@apache.org>
Wed, 23 Mar 2005 13:51:37 +0000 (13:51 +0000)
committerJeremias Maerki <jeremias@apache.org>
Wed, 23 Mar 2005 13:51:37 +0000 (13:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_KnuthStylePageBreaking@198538 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/KnuthBox.java
src/java/org/apache/fop/layoutmgr/KnuthGlue.java
src/java/org/apache/fop/layoutmgr/KnuthPenalty.java

index 4bc7cd24fe160ecadcc19ff8517ad9266a31305d..77f463068f754a2bcc5844d9048601f564b445c8 100644 (file)
@@ -44,8 +44,21 @@ public class KnuthBox extends KnuthElement {
         super(w, pos, bAux);
     }
 
+    /** @see org.apache.fop.layoutmgr.KnuthElement#isBox() */
     public boolean isBox() {
         return true;
     }
 
+    /** @see java.lang.Object#toString() */
+    public String toString() {
+        StringBuffer sb = new StringBuffer(64);
+        if (isAuxiliary()) {
+            sb.append("aux. ");
+        }
+        sb.append("box");
+        sb.append(" w=");
+        sb.append(getW());
+        return sb.toString();
+    }
+    
 }
index 9b5f7862753e1b9425e6aaa6e02a4a5e622651ab..299266ed8caffe0cb7624447c6a6c0395f96e4c0 100644 (file)
@@ -73,26 +73,40 @@ public class KnuthGlue extends KnuthElement {
         adjustmentClass = iAdjClass;
     }
 
+    /** @see org.apache.fop.layoutmgr.KnuthElement#isGlue() */
     public boolean isGlue() {
         return true;
     }
 
-    /**
-     * Return the stretchability of this glue.
-     */
+    /** @return the stretchability of this glue. */
     public int getY() {
         return stretchability;
     }
 
-    /**
-     * Return the shrinkability of this glue.
-     */
+    /** @return the shrinkability of this glue. */
     public int getZ() {
         return shrinkability;
     }
     
+    /** @return the adjustment class (or role) of this glue. */
     public int getAdjustmentClass() {
         return adjustmentClass;
     }
     
+    /** @see java.lang.Object#toString() */
+    public String toString() {
+        StringBuffer sb = new StringBuffer(64);
+        if (isAuxiliary()) {
+            sb.append("aux. ");
+        }
+        sb.append("glue");
+        sb.append(" w=").append(getW());
+        sb.append(" stretch=").append(getY());
+        sb.append(" shrink=").append(getZ());
+        if (getAdjustmentClass() >= 0) {
+            sb.append(" adj-class=").append(getAdjustmentClass());
+        }
+        return sb.toString();
+    }
+    
 }
index fd88fa76ac5dd1a128bd7ffc003db6e5c7c8a2f0..ffef97bffae889b32a27414bb7bae9e2f08c8ee7 100644 (file)
@@ -91,4 +91,31 @@ public class KnuthPenalty extends KnuthElement {
         return breakClass;
     }
     
+    /** @see java.lang.Object#toString() */
+    public String toString() {
+        StringBuffer sb = new StringBuffer(64);
+        if (isAuxiliary()) {
+            sb.append("aux. ");
+        }
+        sb.append("penalty");
+        sb.append(" p=");
+        if (getP() < 0) {
+            sb.append("-");
+        }
+        if (Math.abs(getP()) == INFINITE) {
+            sb.append("INFINITE");
+        } else {
+            sb.append(getP());
+        }
+        if (isFlagged()) {
+            sb.append(" [flagged]");
+        }
+        sb.append(" w=");
+        sb.append(getW());
+        if (isForcedBreak()) {
+            sb.append(" (forced break)");
+        }
+        return sb.toString();
+    }
+    
 }