Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Väljer att ändra från HashMap till LinkedHashMap för att få till ordningen på värden som läggs in. */
- public Map<String, Collection<String>> headlines = new LinkedHashMap<>();
- public TelevisionStation() {
- Timer timer = new Timer();
- timer.schedule(new TimerTask() {
- public void run() {
- if (headlines.size() > 100) {
- System.out.println("Size of headlines too large: " +
- headlines.size());
- }
- }
- }, 10_000, 10_000);
- }
- /* Här smiter referensen headlines till en abstrakt metod.*/
- public void showTeleprompter() {
- printHeadlines(headlines.values());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement