Enum Region

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Region>

    public enum Region
    extends java.lang.Enum<Region>
    Indicates a region of a larger area in internationalized relative terms.
    Author:
    Garret Wilson
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CENTER
      In the center of the area.
      LINE_END
      At the end of a line; "right" in left-to-right, top-to-bottom orientation.
      LINE_START
      At the beginning of a line; "left" in left-to-right, top-to-bottom orientation.
      PAGE_END
      At the end of a page; "bottom" in left-to-right, top-to-bottom orientation.
      PAGE_START
      At the beginning of a page; "top" in left-to-right, top-to-bottom orientation.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int FLOW_REGION_COUNT
      The number of regions for each of the the line and page flows.
      protected static Region[][][] REGIONS
      The three regions for each axis/direction combination.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Region getRegion​(Orientation orientation, Flow flow, int regionIndex)
      Determines the corresponding region for an orientation flow and absolute region number.
      static Region valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Region[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • LINE_START

        public static final Region LINE_START
        At the beginning of a line; "left" in left-to-right, top-to-bottom orientation.
      • LINE_END

        public static final Region LINE_END
        At the end of a line; "right" in left-to-right, top-to-bottom orientation.
      • PAGE_START

        public static final Region PAGE_START
        At the beginning of a page; "top" in left-to-right, top-to-bottom orientation.
      • PAGE_END

        public static final Region PAGE_END
        At the end of a page; "bottom" in left-to-right, top-to-bottom orientation.
      • CENTER

        public static final Region CENTER
        In the center of the area.
    • Field Detail

      • FLOW_REGION_COUNT

        public static final int FLOW_REGION_COUNT
        The number of regions for each of the the line and page flows.
        See Also:
        Constant Field Values
      • REGIONS

        protected static final Region[][][] REGIONS
        The three regions for each axis/direction combination.
    • Method Detail

      • values

        public static Region[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Region c : Region.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Region valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getRegion

        public static Region getRegion​(Orientation orientation,
                                       Flow flow,
                                       int regionIndex)
        Determines the corresponding region for an orientation flow and absolute region number. For example, a left-to-right, top-to-bottom page flow of index 2 will yield PAGE_END, while a right-to-left, top-to-bottom line flow of index 2 will yield LINE_START.
        Parameters:
        orientation - The component orientation.
        flow - The flow (line or page).
        regionIndex - The absolute region index (0, 1, or 2) from the upper left-hand corner.
        Returns:
        The corresponding region for the orientation.
        Throws:
        java.lang.IllegalArgumentException - if the given region index is less than 0 or greater than 2.