< prev index next >

src/java.base/share/classes/java/lang/reflect/Modifier.java

Print this page




  29 
  30 /**
  31  * The Modifier class provides {@code static} methods and
  32  * constants to decode class and member access modifiers.  The sets of
  33  * modifiers are represented as integers with distinct bit positions
  34  * representing different modifiers.  The values for the constants
  35  * representing the modifiers are taken from the tables in sections 4.1, 4.4, 4.5, and 4.7 of
  36  * <cite>The Java&trade; Virtual Machine Specification</cite>.
  37  *
  38  * @see Class#getModifiers()
  39  * @see Member#getModifiers()
  40  *
  41  * @author Nakul Saraiya
  42  * @author Kenneth Russell
  43  * @since 1.1
  44  */
  45 public class Modifier {
  46     /**
  47      * Do not call.
  48      */
  49     @Deprecated(forRemoval=true, since="14")
  50     public Modifier() {}
  51 
  52 
  53     /**
  54      * Return {@code true} if the integer argument includes the
  55      * {@code public} modifier, {@code false} otherwise.
  56      *
  57      * @param   mod a set of modifiers
  58      * @return {@code true} if {@code mod} includes the
  59      * {@code public} modifier; {@code false} otherwise.
  60      */
  61     public static boolean isPublic(int mod) {
  62         return (mod & PUBLIC) != 0;
  63     }
  64 
  65     /**
  66      * Return {@code true} if the integer argument includes the
  67      * {@code private} modifier, {@code false} otherwise.
  68      *
  69      * @param   mod a set of modifiers
  70      * @return {@code true} if {@code mod} includes the




  29 
  30 /**
  31  * The Modifier class provides {@code static} methods and
  32  * constants to decode class and member access modifiers.  The sets of
  33  * modifiers are represented as integers with distinct bit positions
  34  * representing different modifiers.  The values for the constants
  35  * representing the modifiers are taken from the tables in sections 4.1, 4.4, 4.5, and 4.7 of
  36  * <cite>The Java&trade; Virtual Machine Specification</cite>.
  37  *
  38  * @see Class#getModifiers()
  39  * @see Member#getModifiers()
  40  *
  41  * @author Nakul Saraiya
  42  * @author Kenneth Russell
  43  * @since 1.1
  44  */
  45 public class Modifier {
  46     /**
  47      * Do not call.
  48      */
  49     private Modifier() {throw new AssertionError();}

  50 
  51 
  52     /**
  53      * Return {@code true} if the integer argument includes the
  54      * {@code public} modifier, {@code false} otherwise.
  55      *
  56      * @param   mod a set of modifiers
  57      * @return {@code true} if {@code mod} includes the
  58      * {@code public} modifier; {@code false} otherwise.
  59      */
  60     public static boolean isPublic(int mod) {
  61         return (mod & PUBLIC) != 0;
  62     }
  63 
  64     /**
  65      * Return {@code true} if the integer argument includes the
  66      * {@code private} modifier, {@code false} otherwise.
  67      *
  68      * @param   mod a set of modifiers
  69      * @return {@code true} if {@code mod} includes the


< prev index next >