public String getPatternForNumItems ( int count ) { if ( count <= 0 ) { throw new IllegalArgumentException ( "count must be > 0" ) ; } ArrayList < String > list = new ArrayList < String > ( ) ; for ( int i = 0 ; i < count ; i ++ ) { list . add ( String . format ( "{%d}" , i ) ) ; } return format ( list ) ; }
Returns the pattern to use for a particular item count .