Examples of Rule


Examples of ch.pollet.jzic.timezone.Rule

    public void testToPeriods() throws Exception {
        Period period = new Period();
        DateTime from = new DateTime();
        DateTime to = new DateTime();
        DateTime at = new DateTime();
        Rule r = new Rule();
        TreeSet<Period> periods;

        from.setYear(2000);
        from.setMonth(6);
        from.setDay(1);
        from.setHour(0);
        from.setMinute(0);
        from.setSecond(0);
        from.setType(DateTime.Type.UTC);

        to.setYear(2010);
        to.setMonth(6);
        to.setDay(1);
        to.setHour(0);
        to.setMinute(0);
        to.setSecond(0);
        to.setType(DateTime.Type.UTC);

        period.setFrom(from);
        period.setTo(to);
        period.setFormat("_%s");
        period.setOffset(3600);
        period.setPeriodName("PeriodName");

        r.setFormat("_");
        r.setFromYear(1999);
        r.setToYear(2011);
        r.setName("SomeRule");
        r.setOffset(3600);

        //-- Test 1
        at.setMonth(3);
        at.setDay(1);
        at.setHour(0);
        at.setMinute(0);
        at.setSecond(0);
        at.setType(DateTime.Type.UTC);

        r.setAt(at);

        periods = r.toPeriods(period);

        assertEquals(10, periods.size());
        assertEquals("__", periods.first().getPeriodName());
        assertEquals(7200, periods.first().getOffset());
        assertFalse(periods.first().isStdOffset());
        assertEquals(2001, periods.first().getFrom().getYear().intValue());
        assertEquals(2010, periods.last().getFrom().getYear().intValue());
        assertEquals(null, periods.first().getTo());
        assertEquals(null, periods.last().getTo());

        //-- Test 2
        at.setMonth(7);
        at.setDay(1);
        at.setHour(0);
        at.setMinute(0);
        at.setSecond(0);
        at.setType(DateTime.Type.UTC);

        r.setAt(at);

        periods = r.toPeriods(period);

        assertEquals(10, periods.size());
        assertEquals("__", periods.first().getPeriodName());
        assertEquals(7200, periods.first().getOffset());
        assertFalse(periods.first().isStdOffset());
        assertEquals(2000, periods.first().getFrom().getYear().intValue());
        assertEquals(2009, periods.last().getFrom().getYear().intValue());
        assertEquals(null, periods.first().getTo());
        assertEquals(null, periods.last().getTo());

        //-- Test 3
        at.setMonth(6);
        at.setDay(1);
        at.setHour(0);
        at.setMinute(0);
        at.setSecond(0);
        at.setType(DateTime.Type.UTC);

        r.setAt(at);

        periods = r.toPeriods(period);

        assertEquals(11, periods.size());
        assertEquals("__", periods.first().getPeriodName());
        assertEquals(7200, periods.first().getOffset());
        assertFalse(periods.first().isStdOffset());
        assertEquals(2000, periods.first().getFrom().getYear().intValue());
        assertEquals(2010, periods.last().getFrom().getYear().intValue());
        assertEquals(null, periods.first().getTo());
        assertEquals(null, periods.last().getTo());

        r.setOffset(0);
        periods = r.toPeriods(period);
        assertTrue(periods.first().isStdOffset());
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.trans.Rule

    public byte isSpacePreserving(int fingerprint) throws XPathException {
        if (preserveAll) {
            return ALWAYS_PRESERVE;
        }

        Rule rule = stripperMode.getRule(fingerprint);

        if (rule==null) {
            return ALWAYS_PRESERVE;
        }

        return (rule.getAction() == PRESERVE ? ALWAYS_PRESERVE : STRIP_DEFAULT);

    }
View Full Code Here

Examples of com.amazonaws.services.s3.model.BucketLifecycleConfiguration.Rule

        @Override
        public void startElement(String uri, String name, String qName, Attributes attrs) {
            if ( name.equals("LifecycleConfiguration") ) {
            } else if ( name.equals("Rule") ) {
                rule = new Rule();
            } else if ( name.equals("ID") ) {
            } else if ( name.equals("Prefix") ) {
            } else if ( name.equals("Status") ) {
            } else if ( name.equals("Expiration") ) {
            } else if ( name.equals("Days") ) {
View Full Code Here

Examples of com.axemblr.provisionr.api.network.Rule

            .ICMPCode(SecurityGroups.DEFAULT_ICMP_CODE)
            .ICMPType(SecurityGroups.DEFAULT_ICMP_TYPE)
            .CIDR("10.0.0.0/24")
            .build();

        Rule rule = ConvertIngressRuleToRule.FUNCTION.apply(ingressRule);
        assertThat(rule.getProtocol()).isEqualTo(Protocol.ICMP);
        assertThat(rule.getCidr()).isEqualTo(ingressRule.getCIDR());
    }
View Full Code Here

Examples of com.buschmais.jqassistant.core.analysis.api.rule.Rule

    public void endConstraint() throws ReportException {
    }

    @Override
    public void setResult(Result<? extends Rule> result) throws ReportException {
        Rule rule = result.getRule();
        if (rule instanceof Concept && "example:MethodsPerType".equals(rule.getId())) {
            try {
                PrintWriter writer = new PrintWriter(new FileWriter(fileName));
                writer.println("Methods per Type");
                writer.println("================");
                for (Map<String, Object> row : result.getRows()) {
View Full Code Here

Examples of com.clarkparsia.pellet.rules.model.Rule

  public void applyRuleBindings() {

    int total = 0;

    for( PartialBinding ruleBinding : partialBindings ) {
      Rule rule = ruleBinding.getRule();
      VariableBinding initial = ruleBinding.getBinding();

      for( VariableBinding binding : bindingStrategy.createGenerator( rule, initial ) ) {

        Pair<Rule, VariableBinding> ruleKey = new Pair<Rule, VariableBinding>( rule,
View Full Code Here

Examples of com.clarkparsia.pellet.rules.rete.Rule

    ATermAppl var0 = freeVar.next();
    ATermAppl var1 = freeVar.next();
    body.add(makeSubOfSomeTuple(var0, p, var1));
    translateSuper(head, domain, freeVar, var0);

    m_Rules.add(new Rule(body, head));
  }
View Full Code Here

Examples of com.codeforces.graygoose.model.Rule

    }

    @Action("add")
    public void onAdd() {
        try {
            Rule newRule = Rule.newRule(siteId, Rule.RuleType.valueOf(ruleType));
            setupRuleProperties(newRule);

            ruleDao.insert(newRule);

            put("success", true);
View Full Code Here

Examples of com.cosmo.ui.templates.Rule

            nNode = nList.item(temp);
            if (nNode.getNodeType() == Node.ELEMENT_NODE)
            {
               eElement = (Element) nNode;

               this.templateRules.add(new Rule(Rule.RuleType.BrowserAgent,
                                               eElement.getAttribute(UIServiceProperties.XML_UI_ATT_RULE_CONTAINS),
                                               eElement.getAttribute(UIServiceProperties.XML_UI_ATT_RULE_TEMPLATE)));
            }
         }
      }
View Full Code Here

Examples of com.dianping.cat.home.rule.entity.Rule

  private void metricRuleAdd(Payload payload, Model model) {
    String ruleId = "";
    String configHeader = "";
    String configsStr = "";
    String key = m_metricConfigManager.buildMetricKey(payload.getDomain(), payload.getType(), payload.getMetricKey());
    Rule rule = m_businessRuleConfigManager.queryRule(payload.getProductLineName(), key);

    if (rule != null) {
      ruleId = rule.getId();
      configHeader = new DefaultJsonBuilder(true).buildArray(rule.getMetricItems());
      configsStr = new DefaultJsonBuilder(true).buildArray(rule.getConfigs());
    }
    String content = m_ruleDecorator.generateConfigsHtml(configsStr);

    model.setId(ruleId);
    model.setConfigHeader(configHeader);
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.