From 95bec3df3e7037eb6fc59270fed288bad8ff73d1 Mon Sep 17 00:00:00 2001 From: Adrian Cumiskey Date: Fri, 4 Jul 2008 14:12:37 +0000 Subject: Replaced conditional with a switch and capitalized method javadoc description. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@674065 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/area/Page.java | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/java') diff --git a/src/java/org/apache/fop/area/Page.java b/src/java/org/apache/fop/area/Page.java index 94a394014..ddc2a95ab 100644 --- a/src/java/org/apache/fop/area/Page.java +++ b/src/java/org/apache/fop/area/Page.java @@ -209,27 +209,28 @@ public class Page extends AreaTreeObject implements Serializable, Cloneable { /** * 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 */ -- cgit v1.2.3