TV-Browser 2.7.5 API

primarydatamanager.primarydataservice
Class AbstractPrimaryDataService

java.lang.Object
  extended by primarydatamanager.primarydataservice.AbstractPrimaryDataService
All Implemented Interfaces:
PrimaryDataService

public abstract class AbstractPrimaryDataService
extends Object
implements PrimaryDataService

An abstract implementation of PrimaryDataService that makes developing PrimaryDataServices easier.

Author:
Til Schneider, www.murfman.de

Field Summary
static ChannelGroup AUSTRIA
          The TV-Browser channel group 'austria'.
static ChannelGroup DIGITAL
          The TV-Browser channel group 'digital'.
static ChannelGroup LOCAL
          The TV-Browser channel group 'local'.
static ChannelGroup MAIN
          The TV-Browser channel group 'main'.
static ChannelGroup OTHERS
          The TV-Browser channel group 'others'.
static ChannelGroup RADIO
          The TV-Browser channel group 'radio'.
 
Constructor Summary
AbstractPrimaryDataService()
           
 
Method Summary
protected abstract  void execute(String dir)
          Gets the raw TV data and writes it to a directory
 boolean execute(String dir, PrintStream err)
          Gets the raw TV data and writes it to a directory
static int findNumber(String s)
          Searches a number in a String and returns it.
static int getCurrentWeekOfYear(int beginOfWeek)
          Gets the number of the current week of the year (german: Kalenderwoche).
static int getWeekOfYear(Calendar cal, int beginOfWeek)
          Gets the number of the current week of the year (german: Kalenderwoche).
 void logException(Exception exc)
          Logs an exception.
 void logMessage(String msg)
          Logs an message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface primarydatamanager.primarydataservice.PrimaryDataService
getReadBytesCount
 

Field Detail

MAIN

public static final ChannelGroup MAIN
The TV-Browser channel group 'main'.

If you are a third party developer please use your own channel groups.


LOCAL

public static final ChannelGroup LOCAL
The TV-Browser channel group 'local'.

If you are a third party developer please use your own channel groups.


OTHERS

public static final ChannelGroup OTHERS
The TV-Browser channel group 'others'.

If you are a third party developer please use your own channel groups.


DIGITAL

public static final ChannelGroup DIGITAL
The TV-Browser channel group 'digital'.

If you are a third party developer please use your own channel groups.


RADIO

public static final ChannelGroup RADIO
The TV-Browser channel group 'radio'.

If you are a third party developer please use your own channel groups.


AUSTRIA

public static final ChannelGroup AUSTRIA
The TV-Browser channel group 'austria'.

If you are a third party developer please use your own channel groups.

Constructor Detail

AbstractPrimaryDataService

public AbstractPrimaryDataService()
Method Detail

execute

public final boolean execute(String dir,
                             PrintStream err)
Gets the raw TV data and writes it to a directory

Specified by:
execute in interface PrimaryDataService
Parameters:
dir - The directory to write the raw TV data to.
err - The stream to print error messages to.
Returns:
Whether there were errors.

execute

protected abstract void execute(String dir)
Gets the raw TV data and writes it to a directory

Parameters:
dir - The directory to write the raw TV data to.

logException

public final void logException(Exception exc)
Logs an exception.

Parameters:
exc - The exception to log.
See Also:
logMessage(String)

logMessage

public final void logMessage(String msg)
Logs an message. Use this only for informations, for errors use logException(Exception).

Parameters:
msg -
See Also:
logException(Exception)

getCurrentWeekOfYear

public static int getCurrentWeekOfYear(int beginOfWeek)
Gets the number of the current week of the year (german: Kalenderwoche).

Parameters:
beginOfWeek - The first day of the week. Usually either Calendar.MONDAY or Calendar.SUNDAY.
Returns:
The current week of the year

getWeekOfYear

public static int getWeekOfYear(Calendar cal,
                                int beginOfWeek)
Gets the number of the current week of the year (german: Kalenderwoche).

Parameters:
cal - The Calendar object to use.
beginOfWeek - The first day of the week. Usually either Calendar.MONDAY or Calendar.SUNDAY.
Returns:
The current week of the year

findNumber

public static int findNumber(String s)
Searches a number in a String and returns it. E.g. "g 12qp bla 567" will return 12.

Warning: Since the return is a int, "12.54" will return 12, not 12.54

Parameters:
s - The String to search for a number.
Returns:
The found number or -1 if there was no number.

TV-Browser 2.7.5 API

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