public List < JavaComment > javaDocOnly ( final List < JavaComment > originals ) { final List < JavaComment > results = new ArrayList < JavaComment > ( originals . size ( ) ) ; for ( JavaComment comment : originals ) { comment . _switch ( new JavaComment . SwitchBlockWithDefault ( ) { @ Override public void _case ( JavaDocComment x ) { results . add ( x ) ; } @ Override protected void _default ( JavaComment x ) { // do nothing, we only want to add javadocs } } ) ; } return results ; }
Turns a list of JavaComment into list of comments that only has javadoc comments