AccessFlags.javaAPI DocJava SE 5 API6023Fri Aug 26 14:55:16 BST


public abstract class AccessFlags extends Object
Super class for all objects that have modifiers like private, final, ... I.e. classes, fields, and methods.
$Id:,v 2001/10/29 19:59:57 jvanzyl Exp $
M. Dahm

Fields Summary
protected int
Constructors Summary
public AccessFlags()

public AccessFlags(int a)

a inital access flags

    access_flags = a;
Methods Summary
public final intgetAccessFlags()

Access flags of the object.

 return access_flags; 
public final voidisAbstract(boolean flag)

 setFlag(Constants.ACC_ABSTRACT, flag); 
public final booleanisAbstract()

    return (access_flags & Constants.ACC_ABSTRACT) != 0;
public final voidisFinal(boolean flag)

 setFlag(Constants.ACC_FINAL, flag); 
public final booleanisFinal()

    return (access_flags & Constants.ACC_FINAL) != 0;
public final voidisInterface(boolean flag)

 setFlag(Constants.ACC_INTERFACE, flag); 
public final booleanisInterface()

    return (access_flags & Constants.ACC_INTERFACE) != 0;
public final voidisNative(boolean flag)

 setFlag(Constants.ACC_NATIVE, flag); 
public final booleanisNative()

    return (access_flags & Constants.ACC_NATIVE) != 0;
public final voidisPrivate(boolean flag)

 setFlag(Constants.ACC_PRIVATE, flag); 
public final booleanisPrivate()

    return (access_flags & Constants.ACC_PRIVATE) != 0;
public final voidisProtected(boolean flag)

 setFlag(Constants.ACC_PROTECTED, flag); 
public final booleanisProtected()

    return (access_flags & Constants.ACC_PROTECTED) != 0;
public final voidisPublic(boolean flag)

 setFlag(Constants.ACC_PUBLIC, flag); 
public final booleanisPublic()

    return (access_flags & Constants.ACC_PUBLIC) != 0;
public final voidisStatic(boolean flag)

 setFlag(Constants.ACC_STATIC, flag); 
public final booleanisStatic()

    return (access_flags & Constants.ACC_STATIC) != 0;
public final voidisStrictfp(boolean flag)

 setFlag(Constants.ACC_STRICT, flag); 
public final booleanisStrictfp()

    return (access_flags & Constants.ACC_STRICT) != 0;
public final voidisSynchronized(boolean flag)

 setFlag(Constants.ACC_SYNCHRONIZED, flag); 
public final booleanisSynchronized()

    return (access_flags & Constants.ACC_SYNCHRONIZED) != 0;
public final voidisTransient(boolean flag)

 setFlag(Constants.ACC_TRANSIENT, flag); 
public final booleanisTransient()

    return (access_flags & Constants.ACC_TRANSIENT) != 0;
public final voidisVolatile(boolean flag)

 setFlag(Constants.ACC_VOLATILE, flag); 
public final booleanisVolatile()

    return (access_flags & Constants.ACC_VOLATILE) != 0;
public final voidsetAccessFlags(int access_flags)

access_flags Access flags of the object.

    this.access_flags = access_flags;
private final voidsetFlag(int flag, boolean set)

    if((access_flags & flag) != 0) { // Flag is set already
      if(!set) // Delete flag ?
	access_flags ^= flag;
    } else {   // Flag not set
      if(set)  // Set flag ?
	access_flags |= flag;