|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jml2b.util.Profiler jml2b.structure.java.Modifiers
Class used to represent Java modifiers .
Constructor Summary | |
Modifiers(antlr.collections.AST tree)
Creates a new instance, initialising the modifiers from the given AST. |
|
Modifiers(int flags)
Creates a new instance, initialising the modifiers from the given flags. |
Method Summary | |
void |
clearFlag(int flag)
Clear the given flag(s). |
java.lang.String |
emit()
|
boolean |
isCompatible(IModifiers modifiers)
Indicates wether the modifier is compatible with the given modifier. |
boolean |
isExternalVisible()
Returns true if the modifier allow external visibility (that is visibility outside of the package). |
boolean |
isFinal()
|
boolean |
isJml()
|
boolean |
isPackageVisible()
Indicates wether the modifier corresponds to the package visibility. |
boolean |
isPrivate()
Indicates wether the modifier has the private modifier set. |
boolean |
isProtected()
Indicates wether the modifier has the protected modifier set. |
boolean |
isProtectedNotSpecPublic()
Return true iff the protected modifier is set,
and not the spec_public modifier. |
boolean |
isSet(int flag)
Returns true if flag is set, false otherwise. |
boolean |
isStatic()
Indicates wether the modifier has the static modifier set. |
void |
parse(antlr.collections.AST tree)
Initialise the modifiers from the given AST. |
void |
setFlag(int flag)
Sets the given flag(s). |
Methods inherited from class jml2b.util.Profiler |
runGC |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Modifiers(antlr.collections.AST tree)
tree
- the AST that should be used for initialising the
modifiers.public Modifiers(int flags)
flags
should contain a bitmask of the values defined
in the ModFlags
interface.
flags
- a bitmask of the modifiers, using the constants defined
in the ModFlags
interface.ModFlags
Method Detail |
public void parse(antlr.collections.AST tree)
tree
- the AST corresponding to the modifiers declaration.public boolean isExternalVisible()
That is, if the modifier is public
, protected
or
spec_public
.
It should be noted that if this method returns true, that does not
means that the corresponding declaration is obligatory visible (it can be
protected
).
isExternalVisible
in interface IModifiers
true
if the modifier allow external
visibility, false
otherwise.public boolean isStatic()
static
modifier set.
isStatic
in interface IModifiers
true
if the static
modifier
is set, false
otherwise.public boolean isFinal()
isFinal
in interface IModifiers
public boolean isJml()
public boolean isPrivate()
private
modifier set.
isPrivate
in interface IModifiers
true
if the private
modifier
is set, false
otherwise.public boolean isProtected()
protected
modifier set.
isProtected
in interface IModifiers
true
if the protected
modifier
is set, false
otherwise.public boolean isPackageVisible()
public
, private
nor
protected
modifiers are set.
isPackageVisible
in interface IModifiers
true
if the modifiers corresponds to
a package
visibility, false
otherwise.public boolean isProtectedNotSpecPublic()
true
iff the protected
modifier is set,
and not the spec_public
modifier.
isProtectedNotSpecPublic
in interface IModifiers
true
iff the protected
modifier
is set, and not the spec_public
modifier.public boolean isSet(int flag)
true
if flag is set, false
otherwise.
true
if flag is set, false
otherwise.public void setFlag(int flag)
flag
- a bitmask of the flags that should be sets. Valid flags
are defined in the ModFlags
interface.ModFlags
public void clearFlag(int flag)
flag
- a bitmask of the flags that should be sets. Valid flags
are defined in the ModFlags
interface.ModFlags
public boolean isCompatible(IModifiers modifiers)
modifiers
- the modifiers that should be checked for
compatibility.public java.lang.String emit()
emit
in interface IModifiers
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |