@Test public void testCountNodeFromType() { assertEquals( 2, function.countNodeFromType( NodeKind.WHILE ) ); }
public final int countNodeFromType( final NodeKind type ) { int count = 0; if ( is( type ) ) { count++; } if ( numChildren() > 0 ) { for ( final IParserNode child : getChildren() ) { count += child.countNodeFromType( type ); } } return count; }
NestedNode { public final int countNodeFromType( final NodeKind type ) { int count = 0; if ( is( type ) ) { count++; } if ( numChildren() > 0 ) { for ( final IParserNode child : getChildren() ) { count += child.countNodeFromType( type ); } } return count; } }
NestedNode { public final int countNodeFromType( final NodeKind type ) { int count = 0; if ( is( type ) ) { count++; } if ( numChildren() > 0 ) { for ( final IParserNode child : getChildren() ) { count += child.countNodeFromType( type ); } } return count; } protected  NestedNode( final NodeKind idToBeSet ); protected  NestedNode( final NodeKind idToBeSet,
                         final IParserNode childToBeSet ); }
NestedNode { public final int countNodeFromType( final NodeKind type ) { int count = 0; if ( is( type ) ) { count++; } if ( numChildren() > 0 ) { for ( final IParserNode child : getChildren() ) { count += child.countNodeFromType( type ); } } return count; } protected  NestedNode( final NodeKind idToBeSet ); protected  NestedNode( final NodeKind idToBeSet,
                         final IParserNode childToBeSet ); final int computeCyclomaticComplexity(); final int countNodeFromType( final NodeKind type ); final IParserNode getChild( final int index ); List< IParserNode > getChildren(); NodeKind getId(); IParserNode getLastChild(); final boolean is( final NodeKind expectedType ); final int numChildren(); }
NestedNode { public final int countNodeFromType( final NodeKind type ) { int count = 0; if ( is( type ) ) { count++; } if ( numChildren() > 0 ) { for ( final IParserNode child : getChildren() ) { count += child.countNodeFromType( type ); } } return count; } protected  NestedNode( final NodeKind idToBeSet ); protected  NestedNode( final NodeKind idToBeSet,
                         final IParserNode childToBeSet ); final int computeCyclomaticComplexity(); final int countNodeFromType( final NodeKind type ); final IParserNode getChild( final int index ); List< IParserNode > getChildren(); NodeKind getId(); IParserNode getLastChild(); final boolean is( final NodeKind expectedType ); final int numChildren();  }