Hi, as Values inherits from ArrayList, you can also use .ensureCapacity(int).
-Matthias On 01/02/2016 04:41 PM, Nathan Leung wrote: > Is there a use case that requires the first? I thought most people use > Values which has a variadic constructor so you know the length already > anyways. > > The second doesn't map cleanly. If you pass a set, how do you order the > elements in the tuple? You can just pass your collection as a field in the > tuple if that's what you need to do. > On Jan 2, 2016 1:44 AM, "Sachin Pasalkar" <[email protected]> > wrote: > >> Hi, >> >> Can we add some more constructor in backtype.storm.tuple.Values class >> which are already present in ArrayList class. Some examples are below >> >> >> public Values(int initialCapacity) { >> >> super(initialCapacity); >> >> } >> >> This will help us in some performance management if we know what size the >> list going to be. >> >> >> public Values(Collection<? extends Object> c) { >> >> super(c); >> >> } >> >> >> This will allow us the addling predefined list to values instead of >> manually iterating over it. We cannot use Values(Object... vals) as it >> treat list of element as one element >> >> >> Thanks, >> >> Sachin >> >> >
signature.asc
Description: OpenPGP digital signature
