< prev index next >

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

Print this page




  27 
  28 import java.util.StringJoiner;
  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
  71      * {@code private} modifier; {@code false} otherwise.
  72      */
  73     public static boolean isPrivate(int mod) {




  27 
  28 import java.util.StringJoiner;
  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      * Return {@code true} if the integer argument includes the
  48      * {@code public} modifier, {@code false} otherwise.
  49      *
  50      * @param   mod a set of modifiers
  51      * @return {@code true} if {@code mod} includes the
  52      * {@code public} modifier; {@code false} otherwise.
  53      */
  54     public static boolean isPublic(int mod) {
  55         return (mod & PUBLIC) != 0;
  56     }
  57 
  58     /**
  59      * Return {@code true} if the integer argument includes the
  60      * {@code private} modifier, {@code false} otherwise.
  61      *
  62      * @param   mod a set of modifiers
  63      * @return {@code true} if {@code mod} includes the
  64      * {@code private} modifier; {@code false} otherwise.
  65      */
  66     public static boolean isPrivate(int mod) {


< prev index next >