net.anidb.udp
Class UdpAnimeFactory

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

public class UdpAnimeFactory
extends java.lang.Object

A factory for Anime objects.

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

Method Summary
 Anime getAnime(long animeId)
          Returns the anime with the given Id.
 Anime getAnime(long animeId, AnimeMask mask)
          Returns the anime with the given Id.
 Anime getAnime(java.lang.String animeName)
          Returns the anime with the given name.
 Anime getAnime(java.lang.String animeName, AnimeMask mask)
          Returns the anime with the given name.
static UdpAnimeFactory 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 UdpAnimeFactory 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.

getAnime

public Anime getAnime(long animeId)
               throws UdpConnectionException,
                      AniDbException
Returns the anime with the given Id.

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

getAnime

public Anime getAnime(java.lang.String animeName)
               throws UdpConnectionException,
                      AniDbException
Returns the anime with the given name.

Parameters:
animeName - The anime name.
Returns:
The anime.
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_ANIME

getAnime

public Anime getAnime(long animeId,
                      AnimeMask mask)
               throws UdpConnectionException,
                      AniDbException

Returns the anime with the given Id.

Only the fields specified by the mask will be filled.

Parameters:
animeId - The anime Id.
mask - The mask.
Returns:
The anime.
Throws:
UdpConnectionException - If a connection problem occured.
AniDbException - If a problem with AniDB occured.
See Also:
UdpReturnCodes.NO_SUCH_ANIME

getAnime

public Anime getAnime(java.lang.String animeName,
                      AnimeMask mask)
               throws UdpConnectionException,
                      AniDbException

Returns the anime with the given name.

Only the fields specified by the mask will be filled.

Parameters:
animeName - The anime name.
mask - The mask.
Returns:
The anime.
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_ANIME