private Renderer getPrototypeByIndex ( final int prototypeIndex ) { Renderer prototypeSelected = null ; int i = 0 ; for ( Renderer prototype : prototypes ) { if ( i == prototypeIndex ) { prototypeSelected = prototype ; } i ++ ; } return prototypeSelected ; }
Search one prototype using the prototype index which is equals to the view type . This method has to be implemented because prototypes member is declared with Collection and that interface doesn t allow the client code to get one element by index .