All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.snapscript.tree.ModifierChecker Maven / Gradle / Ivy

There is a newer version: 1.4.6
Show newest version
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);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy