org.snapscript.tree.ModifierData 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.InternalStateException;
import org.snapscript.core.ModifierType;
public class ModifierData {
private final ModifierType[] types;
public ModifierData(ModifierType... types) {
this.types = types;
}
public int getModifiers(){
int mask = 0;
for(ModifierType type : types) {
if(type != null) {
if((mask & type.mask) == type.mask) {
throw new InternalStateException("Modifier '" + type + "' declared twice");
}
mask |= type.mask;
}
}
return mask;
}
}