@ SuppressWarnings ( "unchecked" ) public < T extends ElementBase > T getChild ( Class < T > clazz , ElementBase last ) { int i = last == null ? - 1 : children . indexOf ( last ) ; for ( i ++ ; i < children . size ( ) ; i ++ ) { if ( clazz . isInstance ( children . get ( i ) ) ) { return ( T ) children . get ( i ) ; } } return null ; }
Locates and returns a child that is an instance of the specified class . If none is found returns null .