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

public prependChild ( ASTNode disownedChild ) : int
disownedChild ASTNode
Результат int
Пример #1
0
 public void test_ASTNode_prependChild1()
 {
     ASTNode node = new  ASTNode();
       ASTNode c1 = new  ASTNode();
       ASTNode c2 = new  ASTNode();
       ASTNode c1_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) ));
       c1_1.setName( "d");
       i = node.prependChild(c1_1);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( node.getNumChildren() == 3 );
       assertTrue((  "and(d, a, b)" == libsbml.formulaToString(node) ));
       assertTrue((  "d" == node.getChild(0).getName() ));
       assertTrue((  "a" == node.getChild(1).getName() ));
       assertTrue((  "b" == node.getChild(2).getName() ));
       node = null;
 }