Re: Create an empty java.util.Set in VTL

Sergiu Dumitriu <[email protected]> Thu, 25 Jan 2018 11:41:00 -0500
Newsgroups gmane.comp.jakarta.velocity.user
Organization The Apache Foundation
Message-ID <[email protected]>
Not with the default syntax and context. If you can control the context,
you can put an utility that can create any type of collection: random
sets, linked sets, ordered sets, linked maps, ordered maps...

On 01/25/2018 11:30 AM, Christopher Schultz wrote:
> All,
> 
> If I want to create a new empty array/collection, I can do something
> like this:
> 
> #set($array = [])
> 
> If I want to create a new Map, I can do this:
> 
> #set($map = {})
> 
> Is there a way to create a new Set?
> 
> I'd like to use a set because:
> 
> 1. I want to use this object as a sort of scratch-area to know what
> work I've done before
> 
> and
> 
> 2. I'm going to be consulting it a lot using Set.contains(object) so
> something other than ArrayList/LinkedList will be much faster
> 
> Thanks,
> -chris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

-- 
Sergiu Dumitriu
http://purl.org/net/sergiu