Skip to content

Instantly share code, notes, and snippets.

@pk11
Created May 19, 2010 03:33
Show Gist options
  • Save pk11/405916 to your computer and use it in GitHub Desktop.
Save pk11/405916 to your computer and use it in GitHub Desktop.
//normal java
public List<Item> getTitles(Collection<Item> items,String title) {
List<Item> matching = new ArrayList<Item>();
Iterator<Item> iter = items.iterator();
while (iter.hasNext()) {
Item item = iter.next();
if (item.getTitle().equals(title)) {
matching.add(title);
}
}
return matching;
}
//jedi java
public class Item {
...
@JediFilter
public String getTitle() {...}
}
public List<Item> getTitles(Collection<Item> items,String title {
return select(items, getTitleEqualsFilter(title));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment