Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.squawk
Class Modifier

    java.lang.Object
      com.sun.squawk.Modifier

    public final class Modifier

extends Object

The Modifier class provides constants to decode class and member access modifiers. The sets of modifiers are represented as integers with distinct bit positions representing different modifiers. The values for the constants representing the modifiers are taken from The JavaTM Virtual Machine Specification, Second edition tables 4.1, 4.4, 4.5, and 4.7.

The modifiers in the Squawk system augment those defined in the JVM specification to include flags denoting Squawk specific properties of classes and members.

Field Summary
`static int` | `ABSTRACT` The `int` value representing the `abstract` modifier.
`static int` | `ARRAY` The `int` value denoting that a class represents a Java array.
`static int` | `COMPLETE_RUNTIME_STATICS` The `int` value denoting that a class has at least one static variable that requires initialization from a ConstantValue attribute and/or must have a runtime representation because it is accessed via a getstatic or putstatic instruction.
`static int` | `CONSTANT` The `int` value denoting that a field has a ConstantValue.
`static int` | `CONSTRUCTOR` The `int` value denoting that a method is a constructor.
`static int` | `DOUBLEWORD` The `int` value denoting that a class represents a double word type (i.e.
`static int` | `FINAL` The `int` value representing the `final` modifier.
`static int` | `GLOBAL_STATICS` The `int` value denoting that the static fields in a class are `VM global`.
`static int` | `HAS_PRAGMAS` The `int` value denoting that a method has one or more `pragmas` applied to it.
`static int` | `INTERFACE` The `int` value representing the `interface` modifier.
`static int` | `MUSTCLINIT` The `int` value denoting that a class must have its class initializer executed before it is used.
`static int` | `NATIVE` The `int` value representing the `native` modifier.
`static int` | `PRIMITIVE` The `int` value denoting that a class represents a primitive type.
`static int` | `PRIVATE` The `int` value representing the `private` modifier.
`static int` | `PROTECTED` The `int` value representing the `protected` modifier.
`static int` | `PUBLIC` The `int` value representing the `public` modifier.
`static int` | `SOURCE_SYNTHETIC` The `int` value denoting that a class, method or field does not appear in the source code.
`static int` | `SQUAWKARRAY` The `int` value denoting that a class whose instances are represented in the array object format.
`static int` | `SQUAWKPRIMITIVE` The `int` value denoting that a class represents a special class that the Squawk translator and compiler convert into a primitive type.
`static int` | `STATIC` The `int` value representing the `static` modifier.
`static int` | `STRICT` The `int` value representing the `strictfp` modifier.
`static int` | `SUITE_PRIVATE` The `int` value denoting that a class is not exported outside of its suite.
`static int` | `SUPER` The `int` value denoting that superclass methods should be treated specially when invoked by the invokespecial instruction.
`static int` | `SYNCHRONIZED` The `int` value representing the `synchronized` modifier.
`static int` | `SYNTHETIC` The `int` value denoting that a class that does not have a class file representation.
`static int` | `TRANSIENT` The `int` value representing the `transient` modifier.
`static int` | `VOLATILE` The `int` value representing the `volatile` modifier.

Method Summary
`static int` | `getJVMClassModifiers()` Gets the mask of modifiers that are defined the JVM specification that pertain to a class.
`static int` | `getJVMFieldModifiers()` Gets the mask of modifiers that are defined the JVM specification that pertain to a field.
`static int` | `getJVMMethodModifiers()` Gets the mask of modifiers that are defined the JVM specification that pertain to a method.
`static boolean` | `hasConstant(int mod)` Return `true` if the integer argument includes the `CONSTANT` modifer, `false` otherwise.
`static boolean` | `hasGlobalStatics(int mod)`
`static boolean` | `hasPragmas(int mod)` Return `true` if the integer argument includes the `HAS_PRAGMAS` modifer, `false` otherwise.
`static boolean` | `isAbstract(int mod)` Return `true` if the integer argument includes the `abstract` modifer, `false` otherwise.
`static boolean` | `isArray(int mod)` Return `true` if the integer argument includes the `ARRAY` modifer, `false` otherwise.
`static boolean` | `isConstructor(int mod)` Return `true` if the integer argument includes the `CONSTRUCTOR` modifer, `false` otherwise.
`static boolean` | `isDoubleWord(int mod)` Return `true` if the integer argument includes the `DOUBLEWORD` modifer, `false` otherwise.
`static boolean` | `isFinal(int mod)` Return `true` if the integer argument includes the `final` modifer, `false` otherwise.
`static boolean` | `isInterface(int mod)` Return `true` if the integer argument includes the `interface` modifer, `false` otherwise.
`static boolean` | `isNative(int mod)` Return `true` if the integer argument includes the `native` modifer, `false` otherwise.
`static boolean` | `isPackagePrivate(int mod)` Return `true` if the integer argument does not include the `public`, `protected` or `private` modifer, `false` otherwise.
`static boolean` | `isPrimitive(int mod)` Return `true` if the integer argument includes the `PRIMITIVE` modifer, `false` otherwise.
`static boolean` | `isPrivate(int mod)` Return `true` if the integer argument includes the `private` modifer, `false` otherwise.
`static boolean` | `isProtected(int mod)` Return `true` if the integer argument includes the `protected` modifer, `false` otherwise.
`static boolean` | `isPublic(int mod)` Return `true` if the integer argument includes the `public` modifer, `false` otherwise.
`static boolean` | `isSourceSynthetic(int mod)` Return `true` if the integer argument includes the `SOURCE_SYNTHETIC` modifer, `false` otherwise.
`static boolean` | `isSquawkArray(int mod)` Return `true` if the integer argument includes the `SQUAWKARRAY` modifer, `false` otherwise.
`static boolean` | `isSquawkPrimitive(int mod)` Return `true` if the integer argument includes the `SQUAWKPRIMITIVE` modifer, `false` otherwise.
`static boolean` | `isStatic(int mod)` Return `true` if the integer argument includes the `static` modifer, `false` otherwise.
`static boolean` | `isStrict(int mod)` Return `true` if the integer argument includes the `strictfp` modifer, `false` otherwise.
`static boolean` | `isSuitePrivate(int mod)` Return true if the class is not exported from the suite.
`static boolean` | `isSynchronized(int mod)` Return `true` if the integer argument includes the `synchronized` modifer, `false` otherwise.
`static boolean` | `isSynthetic(int mod)` Return `true` if the integer argument includes the `SYNTHETIC` modifer, `false` otherwise.
`static boolean` | `isTransient(int mod)` Return `true` if the integer argument includes the `transient` modifer, `false` otherwise.
`static boolean` | `isVolatile(int mod)` Return `true` if the integer argument includes the `volatile` modifer, `false` otherwise.
`static boolean` | `mustClinit(int mod)` Return `true` if the integer argument includes the `MUSTCLINIT` modifer, `false` otherwise.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### PUBLIC

    public static final int PUBLIC

  The `int` value representing the `public` modifier. For CLASSES, FIELDS, METHODS.

  See Also:
    Constant Field Values

### PRIVATE

    public static final int PRIVATE

  The `int` value representing the `private` modifier. For inner CLASSES, FIELDS, METHODS.

  See Also:
    Constant Field Values

### PROTECTED

    public static final int PROTECTED

  The `int` value representing the `protected` modifier. For inner CLASSES, FIELDS, METHODS.

  See Also:
    Constant Field Values

### STATIC

    public static final int STATIC

  The `int` value representing the `static` modifier. For inner CLASSES, FIELDS, METHODS.

  See Also:
    Constant Field Values

### FINAL

    public static final int FINAL

  The `int` value representing the `final` modifier. For CLASSES, FIELDS, METHODS.

  See Also:
    Constant Field Values

### SYNCHRONIZED

    public static final int SYNCHRONIZED

  The `int` value representing the `synchronized` modifier. For METHODS.

  See Also:
    Constant Field Values

### SUPER

    public static final int SUPER

  The `int` value denoting that superclass methods should be treated specially when invoked by the invokespecial instruction. For CLASSES.

  See Also:
    Constant Field Values

### VOLATILE

    public static final int VOLATILE

  The `int` value representing the `volatile` modifier. For FIELDS.

  See Also:
    Constant Field Values

### TRANSIENT

    public static final int TRANSIENT

  The `int` value representing the `transient` modifier. For FIELDS.

  See Also:
    Constant Field Values

### NATIVE

    public static final int NATIVE

  The `int` value representing the `native` modifier. For METHODS.

  See Also:
    Constant Field Values

### INTERFACE

    public static final int INTERFACE

  The `int` value representing the `interface` modifier. For CLASSES.

  See Also:
    Constant Field Values

### ABSTRACT

    public static final int ABSTRACT

  The `int` value representing the `abstract` modifier. For CLASSES, METHODS.

  See Also:
    Constant Field Values

### STRICT

    public static final int STRICT

  The `int` value representing the `strictfp` modifier. For METHODS (and CLASSES?)

  See Also:
    Constant Field Values

### SOURCE_SYNTHETIC

    public static final int SOURCE_SYNTHETIC

  The `int` value denoting that a class, method or field does not appear in the source code.

  See Also:
    Constant Field Values

### SYNTHETIC

    public static final int SYNTHETIC

  The `int` value denoting that a class that does not have a class file representation.

  See Also:
    Constant Field Values

### CONSTRUCTOR

    public static final int CONSTRUCTOR

  The `int` value denoting that a method is a constructor.

  See Also:
    Constant Field Values

### HAS_PRAGMAS

    public static final int HAS_PRAGMAS

  The `int` value denoting that a method has one or more `pragmas` applied to it.

  See Also:
    Constant Field Values

### CONSTANT

    public static final int CONSTANT

  The `int` value denoting that a field has a ConstantValue.

  See Also:
    Constant Field Values

### MUSTCLINIT

    public static final int MUSTCLINIT

  The `int` value denoting that a class must have its class initializer executed before it is used.

  See Also:
    Constant Field Values

### PRIMITIVE

    public static final int PRIMITIVE

  The `int` value denoting that a class represents a primitive type.

  See Also:
    Constant Field Values

### DOUBLEWORD

    public static final int DOUBLEWORD

  The `int` value denoting that a class represents a double word type (i.e. `long` or `double`).

  See Also:
    Constant Field Values

### ARRAY

    public static final int ARRAY

  The `int` value denoting that a class represents a Java array.

  See Also:
    Constant Field Values

### SQUAWKARRAY

    public static final int SQUAWKARRAY

  The `int` value denoting that a class whose instances are represented in the array object format.

  See Also:
    Constant Field Values

### SQUAWKPRIMITIVE

    public static final int SQUAWKPRIMITIVE

  The `int` value denoting that a class represents a special class that the Squawk translator and compiler convert into a primitive type. Values of these types are not compatible with any other types and requires explicit conversions.

  For efficiency and to avoid meta-circularity, the Squawk primitive variables are intercepted by the translator and converted into the base type (int or long) so no real object is created at run-time.

  There are a number of restrictions that must be observed when programming with these classes. Some of these constraints are imposed to keep the job of the translator simple. All of these constraints are currently enforced by the translator. The constraints are:

  - A local variable slot allocated by javac for a Squawk primitive variable must never be used for a value of any other type (including a different Squawk primitive type). This is required as the translator cannot currently de-multiplex reference type slots into disjoint typed slots. This restriction on javac is achieved by declaring all Squawk primitive local variables at the outer most scope (as javac using lexical based scoping for register allocation liveness).
  - A Squawk primitive value of type T cannot be assigned to or compared with values of any other type (including `null`) than T.
  - A Squawk primitive value of type T cannot be passed as a parameter values of any other type than T. For example, you cannot call T.toString(), or String.valueOf(T). The methods of the classes NativeUnsafe and GC have a special permission to allow Squawk primitive values to passed in place of parameters of type Object.

  See Also:
    Constant Field Values

### COMPLETE_RUNTIME_STATICS

    public static final int COMPLETE_RUNTIME_STATICS

  The `int` value denoting that a class has at least one static variable that requires initialization from a ConstantValue attribute and/or must have a runtime representation because it is accessed via a getstatic or putstatic instruction. This occurs (at least) in the following TCK tests: javasoft.sqe.tests.vm.classfmt.atr.atrcvl004.atrcvl00401m1.atrcvl00401m1_wrapper javasoft.sqe.tests.vm.classfmt.cpl.cplint001.cplint00101m1.cplint00101m1_wrapper javasoft.sqe.tests.vm.classfmt.cpl.cpllng001.cpllng00101m1.cpllng00101m1_wrapper javasoft.sqe.tests.vm.overview.SpecInitMethods.SpecInitMethods004.SpecInitMethods00405m1.SpecInitMethods004_wrapper

  See Also:
    Constant Field Values

### GLOBAL_STATICS

    public static final int GLOBAL_STATICS

  The `int` value denoting that the static fields in a class are `VM global`.

  See Also:
    Constant Field Values

### SUITE_PRIVATE

    public static final int SUITE_PRIVATE

  The `int` value denoting that a class is not exported outside of its suite.

  See Also:
    Constant Field Values

Method Detail

### isPublic

    public static boolean isPublic(int mod)

  Return `true` if the integer argument includes the `public` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `public` modifier; `false` otherwise.

### isPrivate

    public static boolean isPrivate(int mod)

  Return `true` if the integer argument includes the `private` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `private` modifier; `false` otherwise.

### isProtected

    public static boolean isProtected(int mod)

  Return `true` if the integer argument includes the `protected` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `protected` modifier; `false` otherwise.

### isPackagePrivate

    public static boolean isPackagePrivate(int mod)

  Return `true` if the integer argument does not include the `public`, `protected` or `private` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` does not include the `public`, `protected` or `private` modifier; `false` otherwise.

### isStatic

    public static boolean isStatic(int mod)

  Return `true` if the integer argument includes the `static` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `static` modifier; `false` otherwise.

### isFinal

    public static boolean isFinal(int mod)

  Return `true` if the integer argument includes the `final` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `final` modifier; `false` otherwise.

### isSynchronized

    public static boolean isSynchronized(int mod)

  Return `true` if the integer argument includes the `synchronized` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `synchronized` modifier; `false` otherwise.

### isVolatile

    public static boolean isVolatile(int mod)

  Return `true` if the integer argument includes the `volatile` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `volatile` modifier; `false` otherwise.

### isTransient

    public static boolean isTransient(int mod)

  Return `true` if the integer argument includes the `transient` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `transient` modifier; `false` otherwise.

### isNative

    public static boolean isNative(int mod)

  Return `true` if the integer argument includes the `native` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `native` modifier; `false` otherwise.

### isInterface

    public static boolean isInterface(int mod)

  Return `true` if the integer argument includes the `interface` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `interface` modifier; `false` otherwise.

### isAbstract

    public static boolean isAbstract(int mod)

  Return `true` if the integer argument includes the `abstract` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `abstract` modifier; `false` otherwise.

### isStrict

    public static boolean isStrict(int mod)

  Return `true` if the integer argument includes the `strictfp` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `strictfp` modifier; `false` otherwise.

### getJVMClassModifiers

    public static int getJVMClassModifiers()

  Gets the mask of modifiers that are defined the JVM specification that pertain to a class. Note that this does NOT include inner class flags which are part of the inner class attributes.

  Returns:
    the mask of values defined in table 4.1 in the JVM specification

### getJVMMethodModifiers

    public static int getJVMMethodModifiers()

  Gets the mask of modifiers that are defined the JVM specification that pertain to a method.

  Returns:
    the mask of values defined in table 4.5 in the JVM specification

### getJVMFieldModifiers

    public static int getJVMFieldModifiers()

  Gets the mask of modifiers that are defined the JVM specification that pertain to a field.

  Returns:
    the mask of values defined in table 4.4 in the JVM specification

### mustClinit

    public static boolean mustClinit(int mod)

  Return `true` if the integer argument includes the `MUSTCLINIT` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `MUSTCLINIT` modifier; `false` otherwise.

### isPrimitive

    public static boolean isPrimitive(int mod)

  Return `true` if the integer argument includes the `PRIMITIVE` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `PRIMITIVE` modifier; `false` otherwise.

### isSynthetic

    public static boolean isSynthetic(int mod)

  Return `true` if the integer argument includes the `SYNTHETIC` modifer, `false` otherwise. Corresponds to teh class file's Synthetic attribute. For CLASSES, FIELDS, METHODS.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `SYNTHETIC` modifier; `false` otherwise.

### isSourceSynthetic

    public static boolean isSourceSynthetic(int mod)

  Return `true` if the integer argument includes the `SOURCE_SYNTHETIC` modifer, `false` otherwise. For CLASSES, FIELDS, METHODS.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `SOURCE_SYNTHETIC` modifier; `false` otherwise.

### isDoubleWord

    public static boolean isDoubleWord(int mod)

  Return `true` if the integer argument includes the `DOUBLEWORD` modifer, `false` otherwise. For CLASSES.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `DOUBLEWORD` modifier; `false` otherwise.

### isArray

    public static boolean isArray(int mod)
                           throws AllowInlinedPragma

  Return `true` if the integer argument includes the `ARRAY` modifer, `false` otherwise. For CLASSES.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `ARRAY` modifier; `false` otherwise.
  Throws:
    `AllowInlinedPragma`

### isSquawkArray

    public static boolean isSquawkArray(int mod)
                                 throws AllowInlinedPragma

  Return `true` if the integer argument includes the `SQUAWKARRAY` modifer, `false` otherwise. For CLASSES.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `SQUAWKARRAY` modifier; `false` otherwise.
  Throws:
    `AllowInlinedPragma`

### isSquawkPrimitive

    public static boolean isSquawkPrimitive(int mod)
                                     throws AllowInlinedPragma

  Return `true` if the integer argument includes the `SQUAWKPRIMITIVE` modifer, `false` otherwise. For CLASSES.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `SQUAWKPRIMITIVE` modifier; `false` otherwise.
  Throws:
    `AllowInlinedPragma`

### isConstructor

    public static boolean isConstructor(int mod)

  Return `true` if the integer argument includes the `CONSTRUCTOR` modifer, `false` otherwise. For METHODS.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `CONSTRUCTOR` modifier; `false` otherwise.

### hasConstant

    public static boolean hasConstant(int mod)

  Return `true` if the integer argument includes the `CONSTANT` modifer, `false` otherwise. For FIELDS.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `CONSTANT` modifier; `false` otherwise.

### hasPragmas

    public static boolean hasPragmas(int mod)

  Return `true` if the integer argument includes the `HAS_PRAGMAS` modifer, `false` otherwise.

  Parameters:
    `mod` - a set of modifers
  Returns:
    `true` if `mod` includes the `HAS_PRAGMAS` modifier; `false` otherwise.

### hasGlobalStatics

    public static boolean hasGlobalStatics(int mod)

### isSuitePrivate

    public static boolean isSuitePrivate(int mod)

  Return true if the class is not exported from the suite.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

"
For updated information see the Java FRC site
"