xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acumis...@apache.org
Subject svn commit: r674065 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Page.java
Date Fri, 04 Jul 2008 14:12:38 GMT
Author: acumiskey
Date: Fri Jul  4 07:12:37 2008
New Revision: 674065

URL: http://svn.apache.org/viewvc?rev=674065&view=rev
Log:
Replaced conditional with a switch and capitalized method javadoc description.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Page.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Page.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Page.java?rev=674065&r1=674064&r2=674065&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Page.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Page.java Fri Jul  4 07:12:37 2008
@@ -209,27 +209,28 @@
     /**
      * Get the region from this page.
      *
-     * @param areaclass the region area class
+     * @param areaClass the region area class
      * @return the region viewport or null if none
      */
-    public RegionViewport getRegionViewport(int areaclass) {
-        if (areaclass == Constants.FO_REGION_BEFORE) {
+    public RegionViewport getRegionViewport(int areaClass) {
+        switch (areaClass) {
+        case Constants.FO_REGION_BEFORE:
             return regionBefore;
-        } else if (areaclass == Constants.FO_REGION_START) {
+        case Constants.FO_REGION_START:
             return regionStart;
-        } else if (areaclass == Constants.FO_REGION_BODY) {
-            return regionBody;
-        } else if (areaclass == Constants.FO_REGION_END) {
+        case Constants.FO_REGION_BODY:
+            return regionBody;            
+        case Constants.FO_REGION_END:
             return regionEnd;
-        } else if (areaclass == Constants.FO_REGION_AFTER) {
+        case Constants.FO_REGION_AFTER:
             return regionAfter;
+        default:
+            throw new IllegalArgumentException("No such area class with ID = " + areaClass);
         }
-        throw new IllegalArgumentException("No such area class with ID = "
-            + areaclass);
     }
 
     /**
-     * indicates whether any FOs have been added to the body region
+     * Indicates whether any FOs have been added to the body region
      *
      * @return whether any FOs have been added to the body region
      */



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message