本文整理了Java中org.mozilla.zest.core.v1.ZestConditional.removeElse()
方法的一些代码示例,展示了ZestConditional.removeElse()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestConditional.removeElse()
方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestConditional
类名称:ZestConditional
方法名:removeElse
[英]Removes an else.
[中]移除一个其他的。
代码示例来源:origin: mozilla/zest
/**
* Removes an else statement.
*
* @param index the index of the else statement to remove
*/
public void removeElseStatement(int index) {
this.removeElse(this.elseStatements.get(index));
}
代码示例来源:origin: mozilla/zest
/**
* Moves an else.
*
* @param index the destination of the else statement
* @param req the else statement to move
*/
public void moveElse(int index, ZestStatement req) {
this.removeElse(req);
this.addElse(index, req);
}
代码示例来源:origin: mozilla/zest
@Override
public void move(int index, ZestStatement stmt) {
if (this.ifStatements.contains(stmt)) {
this.removeIf(stmt);
this.addIf(index, stmt);
} else if (this.elseStatements.contains(stmt)) {
this.removeElse(stmt);
this.addElse(index, stmt);
} else {
throw new IllegalArgumentException("Not a direct child: " + stmt);
}
}
代码示例来源:origin: mozilla/zest
/**
* Method testRemoveMiddleElse.
*
* @throws Exception
*/
@Test
public void testRemoveMiddleElse() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addElse(req1);
zc.addElse(req2);
zc.addElse(req3);
zc.removeElse(req2);
checkOrder(new ZestStatement[] {zc, req1, req3, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testRemoveFirstElse.
*
* @throws Exception
*/
@Test
public void testRemoveFirstElse() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addElse(req1);
zc.addElse(req2);
zc.addElse(req3);
zc.removeElse(req1);
checkOrder(new ZestStatement[] {zc, req2, req3, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testRemoveMiddleElse.
*
* @throws Exception
*/
@Test
public void testRemoveMiddleElse() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addElse(req1);
zc.addElse(req2);
zc.addElse(req3);
zc.removeElse(req2);
checkOrder(new ZestStatement[] {zc, req1, req3, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testRemoveLastElse.
*
* @throws Exception
*/
@Test
public void testRemoveLastElse() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addElse(req1);
zc.addElse(req2);
zc.addElse(req3);
zc.removeElse(req3);
checkOrder(new ZestStatement[] {zc, req1, req2, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testRemoveFirstElse.
*
* @throws Exception
*/
@Test
public void testRemoveFirstElse() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addElse(req1);
zc.addElse(req2);
zc.addElse(req3);
zc.removeElse(req1);
checkOrder(new ZestStatement[] {zc, req2, req3, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testRemoveLastElse.
*
* @throws Exception
*/
@Test
public void testRemoveLastElse() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addElse(req1);
zc.addElse(req2);
zc.addElse(req3);
zc.removeElse(req3);
checkOrder(new ZestStatement[] {zc, req1, req2, null});
}
代码示例来源:origin: mozilla/zest
zc1.removeElse(zc3);
checkOrder(new ZestStatement[] {zc1, req1, zc2, req2, req3, req5, zc4, req6, null});
代码示例来源:origin: mozilla/zest
zc1.removeElse(zc3);
checkOrder(new ZestStatement[] {zc1, req1, zc2, req2, req3, req5, zc4, req6, null});
内容来源于网络,如有侵权,请联系作者删除!