Guest User

Untitled

a guest
May 25th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. //normal java
  2. public List<Item> getTitles(Collection<Item> items,String title) {
  3. List<Item> matching = new ArrayList<Item>();
  4. Iterator<Item> iter = items.iterator();
  5. while (iter.hasNext()) {
  6. Item item = iter.next();
  7. if (item.getTitle().equals(title)) {
  8. matching.add(title);
  9. }
  10. }
  11.  
  12. return matching;
  13. }
  14.  
  15.  
  16. //jedi java
  17. public class Item {
  18. ...
  19. @JediFilter
  20. public String getTitle() {...}
  21. }
  22.  
  23.  
  24. public List<Item> getTitles(Collection<Item> items,String title {
  25. return select(items, getTitleEqualsFilter(title));
  26. }
Add Comment
Please, Sign In to add comment