//# 0 errors, 105 messages
//#
/*
    //#newsfeed.java:1:1: class: net.sourceforge.pebble.aggregator.NewsFeed
    //#newsfeed.java:1:1: method: net.sourceforge.pebble.aggregator.NewsFeed.net.sourceforge.pebble.aggregator.NewsFeed__static_init
 * Copyright (c) 2003-2006, Simon Brown
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *
 *   - Neither the name of Pebble nor the names of its contributors may
 *     be used to endorse or promote products derived from this software
 *     without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
package net.sourceforge.pebble.aggregator;

import java.util.List;
import java.util.LinkedList;

/**
 * Simple representation of a newsfeed.
 *
 * @author    Simon Brown
 */
public class NewsFeed {

  private String url;
  private String title;
  private String link;
  private List<NewsFeedEntry> entries = new LinkedList<NewsFeedEntry>();
  private long timestamp;

  public NewsFeed(String url) {
    //#newsfeed.java:50: method: void net.sourceforge.pebble.aggregator.NewsFeed.net.sourceforge.pebble.aggregator.NewsFeed(String)
    //#input(void net.sourceforge.pebble.aggregator.NewsFeed(String)): this
    //#input(void net.sourceforge.pebble.aggregator.NewsFeed(String)): url
    //#output(void net.sourceforge.pebble.aggregator.NewsFeed(String)): new LinkedList(NewsFeed#1) num objects
    //#output(void net.sourceforge.pebble.aggregator.NewsFeed(String)): this.entries
    //#output(void net.sourceforge.pebble.aggregator.NewsFeed(String)): this.timestamp
    //#output(void net.sourceforge.pebble.aggregator.NewsFeed(String)): this.url
    //#new obj(void net.sourceforge.pebble.aggregator.NewsFeed(String)): new LinkedList(NewsFeed#1)
    //#post(void net.sourceforge.pebble.aggregator.NewsFeed(String)): this.entries == &new LinkedList(NewsFeed#1)
    //#post(void net.sourceforge.pebble.aggregator.NewsFeed(String)): init'ed(this.timestamp)
    //#post(void net.sourceforge.pebble.aggregator.NewsFeed(String)): this.url == url
    //#post(void net.sourceforge.pebble.aggregator.NewsFeed(String)): init'ed(this.url)
    //#post(void net.sourceforge.pebble.aggregator.NewsFeed(String)): new LinkedList(NewsFeed#1) num objects == 1
    this.url = url;
    this.timestamp = System.currentTimeMillis();
  }
    //#newsfeed.java:53: end of method: void net.sourceforge.pebble.aggregator.NewsFeed.net.sourceforge.pebble.aggregator.NewsFeed(String)

  public String getUrl() {
    return url;
    //#newsfeed.java:56: method: String net.sourceforge.pebble.aggregator.NewsFeed.getUrl()
    //#input(String getUrl()): this
    //#input(String getUrl()): this.url
    //#output(String getUrl()): return_value
    //#pre[2] (String getUrl()): init'ed(this.url)
    //#post(String getUrl()): return_value == this.url
    //#post(String getUrl()): init'ed(return_value)
    //#newsfeed.java:56: end of method: String net.sourceforge.pebble.aggregator.NewsFeed.getUrl()
  }

  public String getTitle() {
    return title;
    //#newsfeed.java:60: method: String net.sourceforge.pebble.aggregator.NewsFeed.getTitle()
    //#input(String getTitle()): this
    //#input(String getTitle()): this.title
    //#output(String getTitle()): return_value
    //#pre[2] (String getTitle()): init'ed(this.title)
    //#post(String getTitle()): return_value == this.title
    //#post(String getTitle()): init'ed(return_value)
    //#newsfeed.java:60: end of method: String net.sourceforge.pebble.aggregator.NewsFeed.getTitle()
  }

  public void setTitle(String title) {
    this.title = title;
    //#newsfeed.java:64: method: void net.sourceforge.pebble.aggregator.NewsFeed.setTitle(String)
    //#input(void setTitle(String)): this
    //#input(void setTitle(String)): title
    //#output(void setTitle(String)): this.title
    //#post(void setTitle(String)): this.title == title
    //#post(void setTitle(String)): init'ed(this.title)
  }
    //#newsfeed.java:65: end of method: void net.sourceforge.pebble.aggregator.NewsFeed.setTitle(String)

  public String getLink() {
    return link;
    //#newsfeed.java:68: method: String net.sourceforge.pebble.aggregator.NewsFeed.getLink()
    //#input(String getLink()): this
    //#input(String getLink()): this.link
    //#output(String getLink()): return_value
    //#pre[2] (String getLink()): init'ed(this.link)
    //#post(String getLink()): return_value == this.link
    //#post(String getLink()): init'ed(return_value)
    //#newsfeed.java:68: end of method: String net.sourceforge.pebble.aggregator.NewsFeed.getLink()
  }

  public void setLink(String link) {
    this.link = link;
    //#newsfeed.java:72: method: void net.sourceforge.pebble.aggregator.NewsFeed.setLink(String)
    //#input(void setLink(String)): link
    //#input(void setLink(String)): this
    //#output(void setLink(String)): this.link
    //#post(void setLink(String)): this.link == link
    //#post(void setLink(String)): init'ed(this.link)
  }
    //#newsfeed.java:73: end of method: void net.sourceforge.pebble.aggregator.NewsFeed.setLink(String)

  public void add(NewsFeedEntry entry) {
    if (entry != null && !entries.contains(entry)) {
    //#newsfeed.java:76: method: void net.sourceforge.pebble.aggregator.NewsFeed.add(NewsFeedEntry)
    //#input(void add(NewsFeedEntry)): entry
    //#input(void add(NewsFeedEntry)): entry.__Tag
    //#input(void add(NewsFeedEntry)): net/sourceforge/pebble/aggregator/NewsFeedEntry.__Descendant_Table[net/sourceforge/pebble/aggregator/NewsFeedEntry]
    //#input(void add(NewsFeedEntry)): net/sourceforge/pebble/aggregator/NewsFeedEntry.__Descendant_Table[others]
    //#input(void add(NewsFeedEntry)): net/sourceforge/pebble/aggregator/NewsFeedEntry.__Dispatch_Table.setFeed(Lnet/sourceforge/pebble/aggregator/NewsFeed;)V
    //#input(void add(NewsFeedEntry)): this
    //#input(void add(NewsFeedEntry)): this.entries
    //#output(void add(NewsFeedEntry)): entry.feed
    //#pre[2] (void add(NewsFeedEntry)): (soft) entry.__Tag == net/sourceforge/pebble/aggregator/NewsFeedEntry
    //#pre[5] (void add(NewsFeedEntry)): (soft) this.entries != null
    //#post(void add(NewsFeedEntry)): entry.feed == One-of{old entry.feed, this}
    //#test_vector(void add(NewsFeedEntry)): entry: Addr_Set{null}, Inverse{null}
    //#test_vector(void add(NewsFeedEntry)): java.util.List:contains(...)@76: {1}, {0}
      entries.add(entry);
      entry.setFeed(this);
    }
  }
    //#newsfeed.java:80: end of method: void net.sourceforge.pebble.aggregator.NewsFeed.add(NewsFeedEntry)

  public List<NewsFeedEntry> getEntries() {
    return entries;
    //#newsfeed.java:83: method: List net.sourceforge.pebble.aggregator.NewsFeed.getEntries()
    //#input(List getEntries()): this
    //#input(List getEntries()): this.entries
    //#output(List getEntries()): return_value
    //#pre[2] (List getEntries()): init'ed(this.entries)
    //#post(List getEntries()): return_value == this.entries
    //#post(List getEntries()): init'ed(return_value)
    //#newsfeed.java:83: end of method: List net.sourceforge.pebble.aggregator.NewsFeed.getEntries()
  }

  public long getTimestamp() {
    return timestamp;
    //#newsfeed.java:87: method: long net.sourceforge.pebble.aggregator.NewsFeed.getTimestamp()
    //#input(long getTimestamp()): this
    //#input(long getTimestamp()): this.timestamp
    //#output(long getTimestamp()): return_value
    //#pre[2] (long getTimestamp()): init'ed(this.timestamp)
    //#post(long getTimestamp()): return_value == this.timestamp
    //#post(long getTimestamp()): init'ed(return_value)
    //#newsfeed.java:87: end of method: long net.sourceforge.pebble.aggregator.NewsFeed.getTimestamp()
  }

}
    //#output(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Descendant_Table[net/sourceforge/pebble/aggregator/NewsFeed]
    //#output(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.add(Lnet/sourceforge/pebble/aggregator/NewsFeedEntry;)V
    //#output(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.getEntries()Ljava/util/List;
    //#output(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.getLink()Ljava/lang/String;
    //#output(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.getTimestamp()J
    //#output(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.getTitle()Ljava/lang/String;
    //#output(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.getUrl()Ljava/lang/String;
    //#output(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.setLink(Ljava/lang/String;)V
    //#output(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.setTitle(Ljava/lang/String;)V
    //#post(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Descendant_Table[net/sourceforge/pebble/aggregator/NewsFeed] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.add(Lnet/sourceforge/pebble/aggregator/NewsFeedEntry;)V == &add
    //#post(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.getEntries()Ljava/util/List; == &getEntries
    //#post(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.getLink()Ljava/lang/String; == &getLink
    //#post(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.getTimestamp()J == &getTimestamp
    //#post(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.getTitle()Ljava/lang/String; == &getTitle
    //#post(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.getUrl()Ljava/lang/String; == &getUrl
    //#post(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.setLink(Ljava/lang/String;)V == &setLink
    //#post(net.sourceforge.pebble.aggregator.NewsFeed__static_init): __Dispatch_Table.setTitle(Ljava/lang/String;)V == &setTitle
    //#newsfeed.java:: end of method: net.sourceforge.pebble.aggregator.NewsFeed.net.sourceforge.pebble.aggregator.NewsFeed__static_init
    //#newsfeed.java:: end of class: net.sourceforge.pebble.aggregator.NewsFeed
