Live template for map iteration
已回答
I write something like this all the time, and I don't think I'm the only one:
Map<Foo, Bar> map=getMap();
for(Foo key:map.keySet())
{
Bar value=map.get(key);
...
Is there a live template for this pattern?
请先登录再写评论。
Use for or iter postfix completion on map.keySet() expression:
No, that one doesn't pull the corresponding values out of the map for each key. It gets half of the job done, though.
Have you tried creating your custom live template for this? For examples check existing templates e.g. under iterations node