TV-Browser 2.7.5 API

tvraterplugin
Class Database

java.lang.Object
  extended by tvraterplugin.Database

public class Database
extends Object

This class holds the "Database" for the Ratings. Could be replaced by a real Database in a later Version...

Author:
bodo tasche

Constructor Summary
Database()
           
 
Method Summary
 void clearChangedPersonal()
          Empties the ChangedPersonal List
 void clearServer()
          Empties the server based ratings list
 ArrayList<Rating> getChangedPersonal()
           
 Rating getPersonalRating(Program program)
          Gets one personal Rating for a specific Program
 Rating getPersonalRating(String title)
          Gets one personal Rating for a specific title
 Collection<Rating> getPersonalRatings()
          Gets the personal Ratings in this Database
 Rating getServerRating(Program program)
          Gets the server rating for a specific program
 Rating getServerRating(String title)
          Gets one server rating for a specific title
 Collection<Rating> getServerRatings()
          Gets the server ratings in this database
 void readData(ObjectInputStream in)
          Called by the host-application during start-up.
 void setPersonalRating(Rating rating)
          Saves the personal rating in the database
 void setServerRating(Rating rating)
          Sets the Rating
 void writeData(ObjectOutputStream out)
          Counterpart to loadData.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Database

public Database()
Method Detail

getServerRatings

public Collection<Rating> getServerRatings()
Gets the server ratings in this database

Returns:
all server ratings

getServerRating

public Rating getServerRating(Program program)
Gets the server rating for a specific program

Parameters:
program - get rating for this program
Returns:
the overall rating

getServerRating

public Rating getServerRating(String title)
Gets one server rating for a specific title

Parameters:
title - get rating for this Title
Returns:
the server Rating

setServerRating

public void setServerRating(Rating rating)
Sets the Rating

Parameters:
rating -

getPersonalRatings

public Collection<Rating> getPersonalRatings()
Gets the personal Ratings in this Database

Returns:
all personal Ratings

getPersonalRating

public Rating getPersonalRating(Program program)
Gets one personal Rating for a specific Program

Parameters:
program - get Rating for this Program
Returns:
the personal Rating

getPersonalRating

public Rating getPersonalRating(String title)
Gets one personal Rating for a specific title

Parameters:
title - get rating for this Title
Returns:
the personal Rating

setPersonalRating

public void setPersonalRating(Rating rating)
Saves the personal rating in the database

Parameters:
rating - save this Rating

getChangedPersonal

public ArrayList<Rating> getChangedPersonal()

clearChangedPersonal

public void clearChangedPersonal()
Empties the ChangedPersonal List


clearServer

public void clearServer()
Empties the server based ratings list


readData

public void readData(ObjectInputStream in)
              throws IOException,
                     ClassNotFoundException
Called by the host-application during start-up. Loads the data.

Throws:
IOException
ClassNotFoundException
See Also:
writeData(ObjectOutputStream)

writeData

public void writeData(ObjectOutputStream out)
               throws IOException
Counterpart to loadData. Called when the application shuts down. Saves the data.

Throws:
IOException
See Also:
readData(ObjectInputStream)

TV-Browser 2.7.5 API

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