Class BitStatus

java.lang.Object
org.miaixz.bus.core.math.BitStatus

public class BitStatus extends Object
通过位运算表示状态的工具类 参数必须是 `偶数` 且 `大于等于0`
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    add(int states, int stat)
    增加状态
    static int
    清空状态就是0
    static boolean
    has(int states, int stat)
    判断是否含有状态
    static int
    remove(int states, int stat)
    删除一个状态

    Methods inherited from class java.lang.Object

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

    • BitStatus

      public BitStatus()
  • Method Details

    • add

      public static int add(int states, int stat)
      增加状态
      Parameters:
      states - 原状态
      stat - 要添加的状态
      Returns:
      新的状态值
    • has

      public static boolean has(int states, int stat)
      判断是否含有状态
      Parameters:
      states - 原状态
      stat - 要判断的状态
      Returns:
      true:有
    • remove

      public static int remove(int states, int stat)
      删除一个状态
      Parameters:
      states - 原状态
      stat - 要删除的状态
      Returns:
      新的状态值
    • clear

      public static int clear()
      清空状态就是0
      Returns:
      0