Examples of OrCondition


Examples of games.stendhal.server.entity.npc.condition.OrCondition

    // player returns while quest is still active
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
        new QuestInStateCondition(QUEST_SLOT, "start"),
        new OrCondition(
          new PlayerHasItemWithHimCondition("leather cuirass"),
          new PlayerHasItemWithHimCondition("pauldroned leather cuirass"))),
      ConversationStates.QUEST_ITEM_BROUGHT,
      "Excuse me, please! I have noticed the leather cuirass you're carrying. Is it for me?",
      null);

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
        new QuestInStateCondition(QUEST_SLOT, "start"),
        new NotCondition(new OrCondition(
          new PlayerHasItemWithHimCondition("leather cuirass"),
          new PlayerHasItemWithHimCondition("pauldroned leather cuirass")))),
      ConversationStates.ATTENDING,
      "Luckily I haven't been robbed while you were away. I would be glad to receive a leather cuirass. Anyway, how can I #help you?",
      null);
View Full Code Here

Examples of games.stendhal.server.entity.npc.condition.OrCondition

    return "MeetKetteh";
  }

  @Override
  public boolean isCompleted(final Player player) {
    return new OrCondition(
            new QuestInStateCondition(QUEST_SLOT,"seen"),
            new QuestInStateCondition(QUEST_SLOT,"learnt_manners"),
            new QuestInStateCondition(QUEST_SLOT,"done")).fire(player, null, null);
  }
View Full Code Here

Examples of games.stendhal.server.entity.npc.condition.OrCondition

          new IncreaseKarmaAction(10)));

    // player returned after climbing the tower partially. reset status to candles done and start again
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new OrCondition(
                new QuestInStateCondition(QUEST_SLOT,"first_step"),
                new QuestInStateCondition(QUEST_SLOT,"second_step"),
                new QuestInStateCondition(QUEST_SLOT,"third_step"),
                new QuestInStateCondition(QUEST_SLOT,"fourth_step"),
                new QuestInStateCondition(QUEST_SLOT,"fifth_step"),
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.xpath.Expression.OrCondition

        }
        if (where == null) {
            return this;
        }
        if (where instanceof OrCondition) {
            OrCondition or = (OrCondition) where;
            if (or.getCommonLeftPart() != null) {
                // @x = 1 or @x = 2
                // is automatically converted to
                // @x in (1, 2)
                // within the query engine
            } else {
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.xpath.Expression.OrCondition

        }
        if (where == null) {
            return this;
        }
        if (where instanceof OrCondition) {
            OrCondition or = (OrCondition) where;
            if (or.getCommonLeftPart() != null) {
                // @x = 1 or @x = 2
                // is automatically converted to
                // @x in (1, 2)
                // within the query engine
            } else if (or.left instanceof Contains && or.right instanceof Contains) {
                // do not optimize "contains"
            } else {
                // conditions of type               
                // @x = 1 or @y = 2
                // or similar are converted to
                // (@x = 1) union (@y = 2)
                Statement s1 = new Statement();
                s1.columnSelector = columnSelector;
                s1.selectors = selectors;
                s1.columnList = columnList;
                s1.where = or.left;
                Statement s2 = new Statement();
                s2.columnSelector = columnSelector;
                s2.selectors = selectors;
                s2.columnList = columnList;
                s2.where = or.right;
                s2.xpathQuery = xpathQuery;
                return new UnionStatement(s1.optimize(), s2.optimize());
            }
        } else if (where instanceof AndCondition) {
            // conditions of type
            // @a = 1 and (@x = 1 or @y = 2)
            // are automatically converted to
            // (@a = 1 and @x = 1) union (@a = 1 and @y = 2)
            AndCondition and = (AndCondition) where;
            if (and.left instanceof OrCondition && !(and.right instanceof OrCondition)) {
                // swap left and right
                and = new AndCondition(and.right, and.left);
            }
            if (and.right instanceof OrCondition) {
                OrCondition or = (OrCondition) and.right;
                if (or.getCommonLeftPart() != null) {
                    // @x = 1 or @x = 2
                    // is automatically converted to
                    // @x in (1, 2)
                    // within the query engine               
                } else if (or.left instanceof Contains && or.right instanceof Contains) {
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.xpath.Expression.OrCondition

        return union;
    }
   
    private static void addToUnionList(Expression condition,  ArrayList<Expression> unionList) {
        if (condition instanceof OrCondition) {
            OrCondition or = (OrCondition) condition;
            if (or.getCommonLeftPart() != null) {
                // @x = 1 or @x = 2
                // is automatically converted to
                // @x in (1, 2)
                // within the query engine
            } else if (or.left instanceof Contains && or.right instanceof Contains) {
                // do not optimize "contains"
            } else {
                // conditions of type               
                // @x = 1 or @y = 2
                // or similar are converted to
                // (@x = 1) union (@y = 2)
                addToUnionList(or.left, unionList);
                addToUnionList(or.right, unionList);
                return;
            }
        } else if (condition instanceof AndCondition) {
            // conditions of type
            // @a = 1 and (@x = 1 or @y = 2)
            // are automatically converted to
            // (@a = 1 and @x = 1) union (@a = 1 and @y = 2)
            AndCondition and = (AndCondition) condition;
            and = and.pullOrRight();
            if (and.right instanceof OrCondition) {
                OrCondition or = (OrCondition) and.right;
                if (or.getCommonLeftPart() != null) {
                    // @x = 1 or @x = 2
                    // is automatically converted to
                    // @x in (1, 2)
                    // within the query engine               
                } else if (or.left instanceof Contains && or.right instanceof Contains) {
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.xpath.Expression.OrCondition

        }
        if (where == null) {
            return this;
        }
        if (where instanceof OrCondition) {
            OrCondition or = (OrCondition) where;
            if (or.getCommonLeftPart() != null) {
                // @x = 1 or @x = 2
                // is automatically converted to
                // @x in (1, 2)
                // within the query engine
            } else {
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.xpath.Expression.OrCondition

   
    private static void addToUnionList(Expression condition,  ArrayList<Expression> unionList) {
        if (condition.containsFullTextCondition()) {
            // do not use union
        } else if (condition instanceof OrCondition) {
            OrCondition or = (OrCondition) condition;
            // conditions of type               
            // @x = 1 or @y = 2
            // or similar are converted to
            // (@x = 1) union (@y = 2)
            addToUnionList(or.left, unionList);
            addToUnionList(or.right, unionList);
            return;
        } else if (condition instanceof AndCondition) {
            // conditions of type
            // @a = 1 and (@x = 1 or @y = 2)
            // are automatically converted to
            // (@a = 1 and @x = 1) union (@a = 1 and @y = 2)
            AndCondition and = (AndCondition) condition;
            and = and.pullOrRight();
            if (and.right instanceof OrCondition) {
                OrCondition or = (OrCondition) and.right;
                // same as above, but with the added "and"
                addToUnionList(new AndCondition(and.left, or.left), unionList);
                addToUnionList(new AndCondition(and.left, or.right), unionList);
                return;
            }
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.xpath.Expression.OrCondition

        }
        if (where == null) {
            return this;
        }
        if (where instanceof OrCondition) {
            OrCondition or = (OrCondition) where;
            Statement s1 = new Statement();
            s1.columnSelector = columnSelector;
            s1.selectors = selectors;
            s1.columnList = columnList;
            s1.where = or.left;
View Full Code Here

Examples of org.apache.uima.ruta.condition.OrCondition

    c = new NotCondition(c1);
    s = v.verbalize(c);
    assertEquals("-AFTER(typeVar)", s);

    // OR
    c = new OrCondition(conds);
    s = v.verbalize(c);
    assertEquals("OR(AFTER(typeVar), AFTER({Type1, typeVar}))", s);

    // PARSE
    c = new ParseCondition(var);
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.