本文整理汇总了C#中libsbmlcs.ASTNode.swapChildren方法的典型用法代码示例。如果您正苦于以下问题:C# ASTNode.swapChildren方法的具体用法?C# ASTNode.swapChildren怎么用?C# ASTNode.swapChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsbmlcs.ASTNode
的用法示例。
在下文中一共展示了ASTNode.swapChildren方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test_ASTNode_swapChildren
public void test_ASTNode_swapChildren()
{
ASTNode node = new ASTNode();
ASTNode c1 = new ASTNode();
ASTNode c2 = new ASTNode();
ASTNode node_1 = new ASTNode();
ASTNode c1_1 = new ASTNode();
ASTNode c2_1 = new ASTNode();
int i = 0;
node.setType(libsbml.AST_LOGICAL_AND);
c1.setName( "a");
c2.setName( "b");
node.addChild(c1);
node.addChild(c2);
assertTrue( node.getNumChildren() == 2 );
assertTrue(( "and(a, b)" == libsbml.formulaToString(node) ));
node_1.setType(libsbml.AST_LOGICAL_AND);
c1_1.setName( "d");
c2_1.setName( "f");
node_1.addChild(c1_1);
node_1.addChild(c2_1);
assertTrue( node_1.getNumChildren() == 2 );
assertTrue(( "and(d, f)" == libsbml.formulaToString(node_1) ));
i = node.swapChildren(node_1);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( node.getNumChildren() == 2 );
assertTrue(( "and(d, f)" == libsbml.formulaToString(node) ));
assertTrue( node_1.getNumChildren() == 2 );
assertTrue(( "and(a, b)" == libsbml.formulaToString(node_1) ));
node_1 = null;
node = null;
}