deepCopy() публичный Метод

public deepCopy ( ) : ASTBase
Результат ASTBase
Пример #1
0
 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
0
 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
0
 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;
 }