Guest User

Untitled

a guest
Jul 3rd, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. package pl.kopara.kguild.tablist.update;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.Collection;
  5. import java.util.Collections;
  6. import java.util.List;
  7.  
  8. import pl.kopara.kguild.data.base.Guild;
  9. import pl.kopara.kguild.data.base.User;
  10.  
  11. public class RankList
  12. {
  13. private static List<Data<User>> topPlayers;
  14. private static List<Data<Guild>> topGuilds;
  15.  
  16. public RankList()
  17. {
  18. topPlayers = Collections.synchronizedList(new ArrayList());
  19. topGuilds = Collections.synchronizedList(new ArrayList());
  20. }
  21.  
  22. public void setTopPlayers(Collection<Data<User>> data) {
  23. topPlayers.clear();
  24. topPlayers.addAll(data);
  25. }
  26.  
  27. public void setTopGuilds(Collection<Data<Guild>> data) {
  28. topGuilds.clear();
  29. topGuilds.addAll(data);
  30. }
  31.  
  32. public static List<Data<User>> getTopPlayers() {
  33. return topPlayers;
  34. }
  35.  
  36. public static List<Data<Guild>> getTopGuilds() {
  37. return topGuilds;
  38. }
  39.  
  40. public static class Data<T> {
  41. private T key;
  42. private int points;
  43.  
  44. public T getKey() {
  45. return this.key;
  46. }
  47.  
  48. public int getPoints() {
  49. return this.points;
  50. }
  51.  
  52. public Data(T key, int points) {
  53. this.key = key;
  54. this.points = points;
  55. }
  56. }
  57. }
Add Comment
Please, Sign In to add comment