TV-Browser 2.7.5 API

newsplugin
Class News

java.lang.Object
  extended by newsplugin.News
All Implemented Interfaces:
Comparable<News>

public class News
extends Object
implements Comparable<News>

One news.

Author:
Til Schneider, www.murfman.de

Constructor Summary
News(Date time, String author, String title, String text, String engTitle, String engText)
          Creates a new instance of News.
 
Method Summary
 int compareTo(News other)
           
 String getAuthor()
          Gets the author.
 String getText()
          Gets the text.
 Date getTime()
          Gets the timestamp of the news.
 String getTitle()
          Gets the title.
static News readData(ObjectInputStream in, int version)
          Loads the news.
 void writeData(ObjectOutputStream out)
          Saves the news.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

News

public News(Date time,
            String author,
            String title,
            String text,
            String engTitle,
            String engText)
Creates a new instance of News.

Parameters:
time - The timestamp of the news
author - The author
title - The title
text - The text
engTitle - The English title
engText - The English text
Method Detail

getTime

public Date getTime()
Gets the timestamp of the news.

Returns:
The timestamp of the news.

getAuthor

public String getAuthor()
Gets the author.

Returns:
The author.

getTitle

public String getTitle()
Gets the title.

Returns:
The title.

getText

public String getText()
Gets the text.

Returns:
The text.

writeData

public void writeData(ObjectOutputStream out)
               throws IOException
Saves the news.

Parameters:
out - The stream to save to
Throws:
IOException - When saving failed.

readData

public static News readData(ObjectInputStream in,
                            int version)
                     throws IOException,
                            ClassNotFoundException
Loads the news.

Parameters:
in - The stream to read from.
version - The file version
Returns:
The read news.
Throws:
IOException - If reading failed
ClassNotFoundException - If the given stream is in a wrong format.

compareTo

public int compareTo(News other)
Specified by:
compareTo in interface Comparable<News>

TV-Browser 2.7.5 API

TV-Browser 2.7.5, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)