本文整理汇总了C#中libsbmlcs.ASTNode.getCharacter方法的典型用法代码示例。如果您正苦于以下问题:C# ASTNode.getCharacter方法的具体用法?C# ASTNode.getCharacter怎么用?C# ASTNode.getCharacter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsbmlcs.ASTNode
的用法示例。
在下文中一共展示了ASTNode.getCharacter方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test_ValidASTNode_setType
public void test_ValidASTNode_setType()
{
ASTNode n = new ASTNode();
int i = n.setType(libsbml.AST_REAL);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( n.getType() == libsbml.AST_REAL );
i = n.setType(libsbml.AST_PLUS);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( n.getType() == libsbml.AST_PLUS );
assertTrue( n.getCharacter() == '+' );
i = n.setType(libsbml.AST_FUNCTION_ARCCOSH);
assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
assertTrue( n.getType() == libsbml.AST_FUNCTION_ARCCOSH );
i = n.setType(libsbml.AST_UNKNOWN);
assertTrue( i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE );
assertTrue( n.getType() == libsbml.AST_UNKNOWN );
n = null;
}
示例2: 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;
}
示例3: test_ASTNode_setCharacter
public void test_ASTNode_setCharacter()
{
ASTNode node = new ASTNode();
node.setName( "foo");
assertTrue( node.getType() == libsbml.AST_NAME );
assertTrue( node.getCharacter() == '\0' );
assertTrue(( "foo" == node.getName() ));
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node.setCharacter( '+');
assertTrue( node.getType() == libsbml.AST_PLUS );
assertTrue( node.getCharacter() == '+' );
assertTrue( node.getName() == null );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node.setCharacter( '-');
assertTrue( node.getType() == libsbml.AST_MINUS );
assertTrue( node.getCharacter() == '-' );
assertTrue( node.getName() == null );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node.setCharacter( '*');
assertTrue( node.getType() == libsbml.AST_TIMES );
assertTrue( node.getCharacter() == '*' );
assertTrue( node.getName() == null );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node.setCharacter( '/');
assertTrue( node.getType() == libsbml.AST_DIVIDE );
assertTrue( node.getCharacter() == '/' );
assertTrue( node.getName() == null );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node.setCharacter( '^');
assertTrue( node.getType() == libsbml.AST_POWER );
assertTrue( node.getCharacter() == '^' );
assertTrue( node.getName() == null );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node.setCharacter( '$');
assertTrue( node.getType() == libsbml.AST_UNKNOWN );
assertTrue( node.getCharacter() == '$' );
assertTrue( node.getName() == null );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node = null;
}
示例4: test_ASTNode_create
public void test_ASTNode_create()
{
ASTNode n = new ASTNode();
EventAssignment ea = new EventAssignment(2,4);
assertTrue( n.getType() == libsbml.AST_UNKNOWN );
assertTrue( n.getCharacter() == '\0' );
assertTrue( n.getName() == null );
assertTrue( n.getInteger() == 0 );
assertTrue( n.getExponent() == 0 );
assertTrue( n.getNumChildren() == 0 );
assertTrue( n.getParentSBMLObject() == null );
ea = null;
n = null;
}
示例5: test_ASTNode_setType
public void test_ASTNode_setType()
{
ASTNode node = new ASTNode();
node.setName( "foo");
assertTrue( node.getType() == libsbml.AST_NAME );
node.setType(libsbml.AST_FUNCTION);
assertTrue( node.getType() == libsbml.AST_FUNCTION );
assertTrue(( "foo" == node.getName() ));
node.setType(libsbml.AST_NAME);
assertTrue( node.getType() == libsbml.AST_NAME );
assertTrue(( "foo" == node.getName() ));
node.setType(libsbml.AST_INTEGER);
assertTrue( node.getType() == libsbml.AST_INTEGER );
node.setType(libsbml.AST_REAL);
assertTrue( node.getType() == libsbml.AST_REAL );
node.setType(libsbml.AST_UNKNOWN);
assertTrue( node.getType() == libsbml.AST_UNKNOWN );
node.setType(libsbml.AST_PLUS);
assertTrue( node.getType() == libsbml.AST_PLUS );
assertTrue( node.getCharacter() == '+' );
node.setType(libsbml.AST_MINUS);
assertTrue( node.getType() == libsbml.AST_MINUS );
assertTrue( node.getCharacter() == '-' );
node.setType(libsbml.AST_TIMES);
assertTrue( node.getType() == libsbml.AST_TIMES );
assertTrue( node.getCharacter() == '*' );
node.setType(libsbml.AST_DIVIDE);
assertTrue( node.getType() == libsbml.AST_DIVIDE );
assertTrue( node.getCharacter() == '/' );
node.setType(libsbml.AST_POWER);
assertTrue( node.getType() == libsbml.AST_POWER );
assertTrue( node.getCharacter() == '^' );
node = null;
}
示例6: test_ASTNode_setReal
public void test_ASTNode_setReal()
{
ASTNode node = new ASTNode();
node.setName( "foo");
assertTrue( node.getType() == libsbml.AST_NAME );
node.setValue(32.1);
assertTrue( node.getType() == libsbml.AST_REAL );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getName() == null );
assertTrue( node.getCharacter() == '\0' );
assertTrue( node.getReal() == 32.1 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
assertTrue( node.getMantissa() == 32.1 );
node.setValue(45,90);
assertTrue( node.getType() == libsbml.AST_RATIONAL );
assertTrue( node.getInteger() == 45 );
assertTrue( node.getName() == null );
assertTrue( node.getCharacter() == '\0' );
assertTrue( node.getReal() == 0.5 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 90 );
assertTrue( node.getMantissa() == 0 );
node.setValue(32.0,4);
assertTrue( node.getType() == libsbml.AST_REAL_E );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getName() == null );
assertTrue( node.getCharacter() == '\0' );
assertTrue( node.getReal() == 320000 );
assertTrue( node.getExponent() == 4 );
assertTrue( node.getDenominator() == 1 );
assertTrue( node.getMantissa() == 32 );
node = null;
}
示例7: test_ASTNode_setName
public void test_ASTNode_setName()
{
string name = "foo";
ASTNode node = new ASTNode();
assertTrue( node.getType() == libsbml.AST_UNKNOWN );
node.setName(name);
assertTrue( node.getType() == libsbml.AST_NAME );
assertTrue(( name == node.getName() ));
assertTrue( node.getCharacter() == '\0' );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
if (node.getName() == name);
{
}
node.setName(null);
assertTrue( node.getType() == libsbml.AST_NAME );
if (node.getName() != null);
{
}
node.setType(libsbml.AST_FUNCTION_COS);
assertTrue( node.getType() == libsbml.AST_FUNCTION_COS );
assertTrue(( "cos" == node.getName() ));
assertTrue( node.getCharacter() == '\0' );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node.setType(libsbml.AST_PLUS);
node.setName(name);
assertTrue( node.getType() == libsbml.AST_NAME );
assertTrue(( name == node.getName() ));
assertTrue( node.getCharacter() == '+' );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node = null;
}
示例8: test_ASTNode_setInteger
public void test_ASTNode_setInteger()
{
ASTNode node = new ASTNode();
node.setName( "foo");
assertTrue( node.getType() == libsbml.AST_NAME );
assertTrue(( "foo" == node.getName() ));
assertTrue( node.getCharacter() == '\0' );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node.setValue(3.2);
assertTrue( node.getType() == libsbml.AST_REAL );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getName() == null );
assertTrue( node.getCharacter() == '\0' );
assertTrue( node.getReal() == 3.2 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node.setValue(321);
assertTrue( node.getType() == libsbml.AST_INTEGER );
assertTrue( node.getInteger() == 321 );
assertTrue( node.getName() == null );
assertTrue( node.getCharacter() == '\0' );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node = null;
}