org.snapscript.tree.ModifierChecker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snap-all Show documentation
Show all versions of snap-all Show documentation
Dynamic scripting for the JVM
package org.snapscript.tree;
import org.snapscript.core.ModifierType;
public class ModifierChecker extends ModifierData {
private ModifierData list;
private int modifiers;
public ModifierChecker(ModifierData list) {
this.modifiers = -1;
this.list = list;
}
public int getModifiers() {
if(modifiers == -1) {
modifiers = list.getModifiers();
}
return modifiers;
}
public boolean isStatic() {
if(modifiers == -1) {
modifiers = list.getModifiers();
}
return ModifierType.isStatic(modifiers);
}
public boolean isConstant() {
if(modifiers == -1) {
modifiers = list.getModifiers();
}
return ModifierType.isConstant(modifiers);
}
public boolean isPublic() {
if(modifiers == -1) {
modifiers = list.getModifiers();
}
return ModifierType.isPublic(modifiers);
}
public boolean isPrivate() {
if(modifiers == -1) {
modifiers = list.getModifiers();
}
return ModifierType.isPrivate(modifiers);
}
public boolean isOverride() {
if(modifiers == -1) {
modifiers = list.getModifiers();
}
return ModifierType.isOverride(modifiers);
}
}