Examples of Rule


Examples of model.tools.firewall.Rule

    // This method creates a new flow with default values.
    public void setupNewRule() {

        disposeEditor();
        rule = new Rule();
        table_rule.removeAll();
        name.setText("");
        dpid.setText("");
        port.setText("");
        action.setText("");
View Full Code Here

Examples of models.Rule

import com.google.common.collect.Lists;
public class RuleTest extends BaseModelTest {
    @Test
    public void testNameContains() {
        Rule r = new Rule();
        r.pattern = "foo";
        r.type = RuleType.NAME_CONTAINS;
        r.dest = "/tmp";

        assertFalse(r.matches("bar"));
        assertTrue(r.matches("foobar"));
        assertTrue(r.matches("barfoo"));
    }
View Full Code Here

Examples of net.sf.lapg.api.Rule

      break;
    }
  }

  public void report(ParserConflict conflict) {
    Rule rule = conflict.getRules()[0];
    if(conflict.getKind() == ParserConflict.FIXED) {
      if(isAnalysisMode()) {
        report(KIND_WARN, conflict.getText(), rule);
      }
    } else {
View Full Code Here

Examples of net.sf.saxon.trans.Rule

        // handle parameters if any

        ParameterSet params = assembleParams(context, actualParams);
        ParameterSet tunnels = assembleTunnelParams(context, tunnelParams);

        Rule currentRule = context.getCurrentTemplateRule();
        if (currentRule==null) {
            XPathException e = new XPathException("There is no current template rule");
            e.setXPathContext(context);
            e.setErrorCode("XTDE0560");
            throw e;
        }
        Mode mode = context.getCurrentMode();
        if (mode == null) {
            mode = controller.getRuleManager().getDefaultMode();
        }
        if (context.getCurrentIterator()==null) {
            XPathException e = new XPathException("There is no context item");
            e.setXPathContext(context);
            e.setErrorCode("XTDE0565");
            throw e;
        }
        Item currentItem = context.getCurrentIterator().current();
        if (!(currentItem instanceof NodeInfo)) {
            XPathException e = new XPathException("Cannot call xsl:next-match when context item is not a node");
            e.setXPathContext(context);
            e.setErrorCode("XTDE0565");
            throw e;
        }
        NodeInfo node = (NodeInfo)currentItem;
        Rule rule = controller.getRuleManager().getNextMatchHandler(node, mode, currentRule, context);

    if (rule==null) {             // use the default action for the node
            ApplyTemplates.defaultAction(node, params, tunnels, context, getLocationId());
        } else if (useTailRecursion) {
            //Template nh = (Template)rule.getAction();
            // clear all the local variables: they are no longer needed
            Arrays.fill(context.getStackFrame().getStackFrameValues(), null);
            return new NextMatchPackage(rule, params, tunnels, context);
        } else {
            Template nh = (Template)rule.getAction();
            XPathContextMajor c2 = context.newContext();
            c2.setOrigin(this);
            c2.setOriginatingConstructType(Location.TEMPLATE);
            c2.openStackFrame(nh.getStackFrameMap());
            c2.setLocalParameters(params);
View Full Code Here

Examples of net.sourceforge.jFuzzyLogic.rule.Rule

    ruleBlock.setName("No1");
    ruleBlock.setRuleAccumulationMethod(new RuleAccumulationMethodMax());
    ruleBlock.setRuleActivationMethod(new RuleActivationMethodMin());

    //       RULE 1 : IF service IS poor OR food is rancid THEN tip IS cheap;
    Rule rule1 = new Rule("Rule1", ruleBlock);
    rule1.addAntecedent(service, "poor", false);
    rule1.addAntecedent(food, "rancid", false);
    rule1.addConsequent(tip, "cheap", false);
    ruleBlock.add(rule1);

    //       RULE 2 : IF service IS good THEN tip IS average;
    Rule rule2 = new Rule("Rule2", ruleBlock);
    rule2.addAntecedent(service, "good", false);
    rule2.addConsequent(tip, "average", false);
    ruleBlock.add(rule2);

    //       RULE 3 : IF ((service IS good) OR (service IS excellent)) AND food IS delicious THEN tip is generous;
    Rule rule3 = new Rule("Rule3", ruleBlock);
    RuleTerm term1 = new RuleTerm(service, "good", false); // Create 'terms'
    RuleTerm term2 = new RuleTerm(service, "excellent", false);
    RuleTerm term3 = new RuleTerm(food, "delicious", false);

    RuleExpression antecedentOr = new RuleExpression(term1, term2, new RuleConnectionMethodOrMax()); // Combine terms using connection methods: OR, AND
    RuleExpression antecedentAnd = new RuleExpression(antecedentOr, term3, new RuleConnectionMethodAndMin());
    rule3.setAntecedents(antecedentAnd); // Set antecedent

    rule3.addConsequent(tip, "generous", false);
    ruleBlock.add(rule3);

    //    END_RULEBLOCK
    //
    //    END_FUNCTION_BLOCK
View Full Code Here

Examples of net.sourceforge.segment.srx.Rule

          after = r.getAfterbreak().getContent();
        } else {
          after = "";
        }

        Rule rule = new Rule(breakRule, before, after);
        languageRule.addRule(rule);
      }
      languageRuleMap.put(languageRule.getName(), languageRule);
    }
View Full Code Here

Examples of net.sourceforge.temply.base.rules.Rule

        _repo = project.getRepository();
    }

    @Test
    public void test() throws Exception {
        Rule sqlServer = _repo.getRule("SqlServer");
        assertNotNull(sqlServer);
        Rule connection = _repo.getRule("Connection");
        assertNotNull(connection);

        Rule sqlServerDev = _repo.getRule("SqlServer.Dev");
        assertNotNull(sqlServerDev);
    }
View Full Code Here

Examples of org.adamtacy.client.ui.effects.impl.css.Rule

  }

  public void setXValue(int newX) {
    moveX = newX;
      if (effectElement != null)
        setNewStyles(new Rule("s{left:0px; top: 0px;}"), new Rule("s{left: "+moveX+"px; top: "+moveY+"px;}"));
  }
View Full Code Here

Examples of org.allspice.parser.Rule

   * @throws StrandedSymbol
   * @throws InvalidStartRule
   */
  private static DefaultTranslationMapper createMapper() throws StateConflict, InvalidStartRule, StrandedSymbol {
    DefaultTranslationMapper mapper = new DefaultTranslationMapper() ;
    mapper.addTranslation(new Rule("E'","E"),new OneTrans()) ;
    mapper.addTranslation(new Rule("E","E","+","F"),new OpTrans()) ;
    mapper.addTranslation(new Rule("E","F"),new OneTrans()) ;
    mapper.addTranslation(new Rule("F","F","*","T"),new OpTrans()) ;
    mapper.addTranslation(new Rule("F","T"),new OneTrans()) ;
    mapper.addTranslation(new Rule("T","id"),new OneTrans()) ;
    mapper.addTranslation(new Rule("T","(","E",")"),new Paren()) ;
    return mapper;
  }
View Full Code Here

Examples of org.antlr.gunit.swingui.model.Rule

        public Component getListCellRendererComponent(
                JList list, Object value, int index,
                boolean isSelected, boolean hasFocus) {

            if(value instanceof Rule) {
                final Rule item = (Rule) value;
                setText(item.toString());
                setForeground(list.getForeground());

                setIcon(item.getNotEmpty() ? ImageFactory.getSingleton().FAV16 : null);

                if(list.getSelectedValue() == item ) {
                    setBackground(Color.LIGHT_GRAY);
                    setOpaque(true);
                } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.