当前位置: 首页>>代码示例>>C#>>正文


C# ASTNode.deepCopy方法代码示例

本文整理汇总了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;
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:16,代码来源:TestASTNode.cs

示例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;
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:16,代码来源:TestASTNode.cs

示例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;
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:38,代码来源:TestASTNode.cs


注:本文中的libsbmlcs.ASTNode.deepCopy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。