org.mozilla.zest.core.v1.ZestExpressionOr.getChild()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(72)

本文整理了Java中org.mozilla.zest.core.v1.ZestExpressionOr.getChild()方法的一些代码示例,展示了ZestExpressionOr.getChild()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestExpressionOr.getChild()方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestExpressionOr
类名称:ZestExpressionOr
方法名:getChild

ZestExpressionOr.getChild介绍

暂无

代码示例

代码示例来源:origin: mozilla/zest

@Override
  public String toString() {
    if (this.getChildrenCondition() == null || this.getChildrenCondition().isEmpty()) {
      return "Empty OR";
    }
    StringBuilder expression = new StringBuilder(150);
    if (isInverse()) {
      expression.append("NOT ");
    }
    expression.append('(');
    int i = 0;
    for (; i < this.getChildrenCondition().size() - 1; i++) {
      expression.append(this.getChild(i).toString()).append(" OR ");
    }
    expression.append(this.getChild(i).toString()).append(')');
    return expression.toString();
  }
}

代码示例来源:origin: mozilla/zest

@Test
public void testOrDeepCopySingleAndSameChildrenClasses() {
  List<ZestExpressionElement> children = new LinkedList<>();
  for (int i = 0; i < 10; i++) {
    children.add(new ZestExpressionLength());
  }
  ZestExpressionOr or = new ZestExpressionOr(children);
  ZestExpressionOr copy = or.deepCopy();
  for (int i = 0; i < children.size(); i++) {
    assertTrue(or.getChild(i).getClass() == copy.getChild(i).getClass());
  }
}

代码示例来源:origin: mozilla/zest

lastChildPrinted < orElement.getChildrenCondition().size() - 1;
    lastChildPrinted++) {
  printExpression(orElement.getChild(lastChildPrinted), indent + 1);
  System.out.print(" || ");
printExpression(orElement.getChild(lastChildPrinted), indent + 1);

相关文章