net.anidb.udp
Class UdpEpisodeFactory

java.lang.Object
  extended by net.anidb.udp.UdpEpisodeFactory

public class UdpEpisodeFactory
extends java.lang.Object

A factory for Episode objects.

Version:
1.0, 25.12.2009
Author:
grizzlyxp (http://anidb.net/perl-bin/animedb.pl?show=userpage&uid=63935)

Method Summary
 Episode getEpisode(long episodeId)
          Returns the episode with the given Id.
 Episode getEpisode(long animeId, long episodeNumber)
          Returns the episode with the given anime Id and episode number.
 Episode getEpisode(java.lang.String animeName, long episodeNumber)
          Returns the episode with the given anime name and episode number.
static UdpEpisodeFactory getInstance(UdpConnection conn)
          Returns an instance of this class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static UdpEpisodeFactory getInstance(UdpConnection conn)
Returns an instance of this class.

Parameters:
conn - The connection.
Returns:
The instance.
Throws:
java.lang.IllegalArgumentException - If the connection is null.

getEpisode

public Episode getEpisode(long episodeId)
                   throws UdpConnectionException,
                          AniDbException
Returns the episode with the given Id.

Parameters:
episodeId - The episode Id.
Returns:
The episode.
Throws:
UdpConnectionException - If a connection problem occured.
AniDbException - If a problem with AniDB occured.
See Also:
UdpReturnCodes.NO_SUCH_EPISODE

getEpisode

public Episode getEpisode(java.lang.String animeName,
                          long episodeNumber)
                   throws UdpConnectionException,
                          AniDbException
Returns the episode with the given anime name and episode number.

Parameters:
animeName - The anime name.
episodeNumber - The episode number.
Returns:
The episode.
Throws:
java.lang.IllegalArgumentException - If the anime name is null.
UdpConnectionException - If a connection problem occured.
AniDbException - If a problem with AniDB occured.
See Also:
UdpReturnCodes.NO_SUCH_EPISODE

getEpisode

public Episode getEpisode(long animeId,
                          long episodeNumber)
                   throws UdpConnectionException,
                          AniDbException
Returns the episode with the given anime Id and episode number.

Parameters:
animeId - The anime Id.
episodeNumber - The episode number.
Returns:
The episode.
Throws:
UdpConnectionException - If a connection problem occured.
AniDbException - If a problem with AniDB occured.
See Also:
UdpReturnCodes.NO_SUCH_EPISODE