Advertisement
Guest User

Untitled

a guest
Nov 19th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. /* Väljer att ändra från HashMap till LinkedHashMap för att få till ordningen på värden som läggs in. */
  2. public Map<String, Collection<String>> headlines = new LinkedHashMap<>();
  3.  
  4. public TelevisionStation() {
  5. Timer timer = new Timer();
  6. timer.schedule(new TimerTask() {
  7. public void run() {
  8. if (headlines.size() > 100) {
  9. System.out.println("Size of headlines too large: " +
  10. headlines.size());
  11. }
  12. }
  13. }, 10_000, 10_000);
  14. }
  15.  
  16. /* Här smiter referensen headlines till en abstrakt metod.*/
  17. public void showTeleprompter() {
  18. printHeadlines(headlines.values());
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement