Created
April 12, 2012 12:13
-
-
Save mathieuancelin/2366858 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Inject Service<SocialProvider> providers; | |
public List<Post> getTimeline() { | |
List<Post> timeline = new ArrayList<Post>(); | |
for (SocialProvider provider : providers) { | |
timeline.addAll(provider.getTimeline()); | |
} | |
Collections.sort(timeline, new Comparator<Post>() { | |
public int compare(Post post1, Post post2) { | |
return post1.timestamp().compare(post2.timestamp()); | |
} | |
}); | |
return timeline; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment