本文整理汇总了C#中libsbmlcs.ASTNode.deepCopy方法的典型用法代码示例。如果您正苦于以下问题:C# ASTNode.deepCopy方法的具体用法?C# ASTNode.deepCopy怎么用?C# ASTNode.deepCopy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsbmlcs.ASTNode
的用法示例。
在下文中一共展示了ASTNode.deepCopy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test_ASTNode_deepCopy_2
public void test_ASTNode_deepCopy_2()
{
ASTNode node = new ASTNode();
ASTNode copy;
node.setName( "Foo");
assertTrue( node.getType() == libsbml.AST_NAME );
assertTrue(( "Foo" == node.getName() ));
assertTrue( node.getNumChildren() == 0 );
copy = node.deepCopy();
assertTrue( copy != node );
assertTrue( copy.getType() == libsbml.AST_NAME );
assertTrue(( "Foo" == copy.getName() ));
assertTrue( copy.getNumChildren() == 0 );
node = null;
copy = null;
}
示例2: test_ASTNode_deepCopy_4
public void test_ASTNode_deepCopy_4()
{
ASTNode node = new ASTNode(libsbml.AST_FUNCTION_ABS);
ASTNode copy;
node.setName( "ABS");
assertTrue( node.getType() == libsbml.AST_FUNCTION_ABS );
assertTrue(( "ABS" == node.getName() ));
assertTrue( node.getNumChildren() == 0 );
copy = node.deepCopy();
assertTrue( copy != node );
assertTrue( copy.getType() == libsbml.AST_FUNCTION_ABS );
assertTrue(( "ABS" == copy.getName() ));
assertTrue( copy.getNumChildren() == 0 );
node = null;
copy = null;
}
示例3: test_ASTNode_deepCopy_1
public void test_ASTNode_deepCopy_1()
{
ASTNode node = new ASTNode();
ASTNode child, copy;
node.setCharacter( '+');
node.addChild(new ASTNode());
node.addChild(new ASTNode());
node.getLeftChild().setValue(1);
node.getRightChild().setValue(2);
assertTrue( node.getType() == libsbml.AST_PLUS );
assertTrue( node.getCharacter() == '+' );
assertTrue( node.getNumChildren() == 2 );
child = node.getLeftChild();
assertTrue( child.getType() == libsbml.AST_INTEGER );
assertTrue( child.getInteger() == 1 );
assertTrue( child.getNumChildren() == 0 );
child = node.getRightChild();
assertTrue( child.getType() == libsbml.AST_INTEGER );
assertTrue( child.getInteger() == 2 );
assertTrue( child.getNumChildren() == 0 );
copy = node.deepCopy();
assertTrue( copy != node );
assertTrue( copy.getType() == libsbml.AST_PLUS );
assertTrue( copy.getCharacter() == '+' );
assertTrue( copy.getNumChildren() == 2 );
child = copy.getLeftChild();
assertTrue( child != node.getLeftChild() );
assertTrue( child.getType() == libsbml.AST_INTEGER );
assertTrue( child.getInteger() == 1 );
assertTrue( child.getNumChildren() == 0 );
child = copy.getRightChild();
assertTrue( child != node.getRightChild() );
assertTrue( child.getType() == libsbml.AST_INTEGER );
assertTrue( child.getInteger() == 2 );
assertTrue( child.getNumChildren() == 0 );
node = null;
copy = null;
}