@ SuppressWarnings ( "unchecked" ) public void preload ( int quantity ) { Object [ ] objects = new Object [ quantity ] ; for ( int i = 0 ; i < quantity ; i ++ ) { objects [ i ] = this . instantiate ( ) ; } for ( int i = 0 ; i < quantity ; i ++ ) { this . release ( ( T ) objects [ i ] ) ; } }
Instantiate quantity numbers of elements from the Pool and set them in the pool right away