public WeightedSupplier < T > add ( Supplier < ? extends T > supplier , int weight ) { if ( weight < 0 ) { return this ; } int low = totalWeight ; totalWeight += weight ; SubSupplier < T > ss = new SubSupplier <> ( low , totalWeight , supplier ) ; subSuppliers . add ( ss ) ; return this ; }
Adds a sub - supplier with a given weight .