[stringtemplate-interest] Use case supported by ST?

Ronald Muller ronald.k.muller at gmail.com
Fri Feb 5 00:27:13 PST 2010


In the set are enums. I have to print "yes" if the set contains the value,
"No" otherwise. So in java code:

final EnumSet<ChecklistItem> checklist = ....
for (ChecklistItem item : ChecklistItem.values()) {
      println(item.getTitle() + ": " + checklist.contains(item) ? "Yes" :
"No");
}

Regards,

Ronald

2010/2/3 Terence Parr <parrt at cs.usfca.edu>

>
> On Feb 3, 2010, at 2:05 AM, Ronald Muller wrote:
>
> > Hi,
> >
> > I have the following use case:
> >
> > I have to list items and display "Yes" or "No" if they are present in a
> set (Checklist items in my case, modeled as enums), So:
> >
> > Task1: Yes
> > Task2: No
> > Task3: No
> > ...
>
> Hi.  What's in the set? must be an object with string/boolean?  wouldn't
> this work then
>
> $yourdomainobject.checkList:{o | $o.str$: $o.bool$}$
>
> Ter
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20100205/b43cc027/attachment.html 


More information about the stringtemplate-interest mailing list