public double evaluar(double valor, boolean error) throws UnknownFunctionException, UnparsableExpressionException { double resultado = 0; Calculable calc = this.parser.withVariable("x", valor).build(); resultado = calc.calculate(); return resultado; }
public void setCalculablesWithGroupDirty() { Set<Calculable> users = getWorldObject().getAll(CalculableType.USER); Set<Calculable> groups = getWorldObject().getAll(CalculableType.GROUP); if (users == null || users.size() == 0) { Debugger.log("Error setting users dirty"); } else { for (Calculable user : users) { if (user.hasGroupRecursive(getName())) ((User) user).setDirty(true); } } if (groups == null || groups.size() == 0) { Debugger.log("Error setting groups dirty"); } else { for (Calculable group : groups) { if (group.hasGroupRecursive(getName())) ((Group) group).setDirty(true); } } }
public boolean hasPermission(String node) { node = node.toLowerCase(); boolean allowed = Calculable.hasPermission(node, getMappedPermissions()); return allowed; }