Class RegionMembershipUtilities

Object
RegionMembershipUtilities

public class RegionMembershipUtilities extends Object
Utility class for managing 8-bit region membership.

This class provides methods for manipulating and checking region membership flags.

  • Method Summary

    Modifier and Type
    Method
    Description
    static byte
    Gets the flag representing no region membership.
    static byte
    flagForRegion(int index)
    Gets the flag for a specific region index.
    static byte
    flagForRegion(int index1, int index2)
    Combines flags for two regions.
    static byte
    flagForRegion(int index1, int index2, int index3)
    Combines flags for three regions.
    static boolean
    isMemberFlagAnd(byte membership, byte flag)
    Checks if a membership flag is set using an AND operation.
    static boolean
    isMemberFlagOr(byte membership, byte flag)
    Checks if a membership flag is set using an OR operation.
    static byte
    setAsMemberFlag(byte membership, byte flag)
    Sets a membership flag.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isMemberFlagAnd

      public static boolean isMemberFlagAnd(byte membership, byte flag)
      Checks if a membership flag is set using an AND operation.
      Parameters:
      membership - the current membership flags
      flag - the flag to check
      Returns:
      true if the flag is set, false otherwise
    • isMemberFlagOr

      public static boolean isMemberFlagOr(byte membership, byte flag)
      Checks if a membership flag is set using an OR operation.
      Parameters:
      membership - the current membership flags
      flag - the flag to check
      Returns:
      true if the flag is set, false otherwise
    • setAsMemberFlag

      public static byte setAsMemberFlag(byte membership, byte flag)
      Sets a membership flag.
      Parameters:
      membership - the current membership flags
      flag - the flag to set
      Returns:
      the updated membership flags
    • flagForNoRegion

      public static byte flagForNoRegion()
      Gets the flag representing no region membership.
      Returns:
      the flag for no region
    • flagForRegion

      public static byte flagForRegion(int index)
      Gets the flag for a specific region index.
      Parameters:
      index - the index of the region (0-6)
      Returns:
      the flag for the specified region
    • flagForRegion

      public static byte flagForRegion(int index1, int index2)
      Combines flags for two regions.
      Parameters:
      index1 - the index of the first region
      index2 - the index of the second region
      Returns:
      the combined flag for both regions
    • flagForRegion

      public static byte flagForRegion(int index1, int index2, int index3)
      Combines flags for three regions.
      Parameters:
      index1 - the index of the first region
      index2 - the index of the second region
      index3 - the index of the third region
      Returns:
      the combined flag for all three regions