FileDocCategorySizeDatePackage
AccessFlags.javaAPI DocJava SE 6 API6433Tue Jun 10 00:22:16 BST 2008com.sun.org.apache.bcel.internal.classfile

AccessFlags

public abstract class AccessFlags extends Object implements Serializable
Super class for all objects that have modifiers like private, final, ... I.e. classes, fields, and methods.
version
$Id: AccessFlags.java,v 1.1.2.1 2005/07/31 23:46:40 jeffsuttor Exp $
author
M. Dahm

Fields Summary
protected int
access_flags
Constructors Summary
public AccessFlags()

public AccessFlags(int a)

param
a inital access flags

    access_flags = a;
  
Methods Summary
public final intgetAccessFlags()

return
Access flags of the object aka. "modifiers".

 return access_flags; 
public final intgetModifiers()

return
Access flags of the object aka. "modifiers".

 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)
Set access flags aka "modifiers".

param
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;
    }
  
public final voidsetModifiers(int access_flags)
Set access flags aka "modifiers".

param
access_flags Access flags of the object.

    setAccessFlags(access_flags);