nz.ac.waikato.mcennis.rat.graph.artist.decider
Class ArtistDeciderBase

java.lang.Object
  extended by nz.ac.waikato.mcennis.rat.graph.artist.decider.ArtistDeciderBase
All Implemented Interfaces:
ArtistDecider, ParsedObject
Direct Known Subclasses:
BasicArtistDecider, GoogleDecider, LastFMDecider, YahooArtistDecider

public abstract class ArtistDeciderBase
extends java.lang.Object
implements ArtistDecider, ParsedObject

Common base class for deciding whether or not something belongs to a class or not. Provides the abstract lookup method to implement class specific lookup code.


Constructor Summary
protected ArtistDeciderBase()
          Creates a new instance of GoogleArtistDecider
 
Method Summary
 void addArtist(java.lang.String a)
          Manually adds an artist to the list of known artists
 void addChecked(java.lang.String c)
          Manually adds to the list of seen artists, but not known artists, effectively labeling it non-artist.
 boolean isArtist(java.lang.String name)
          Basic outline of a checked name.
protected  boolean isChecked(java.lang.String name)
          Has this decider seen this particular string before?
protected abstract  void lookup(java.lang.String name)
          Overridden to provide a means of determining an artist from a non-artist
static ArtistDeciderBase newInstance()
          Only mechanism for getting access to this singleton object.
 void output(java.io.Writer outs)
          Write this decider to XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nz.ac.waikato.mcennis.rat.graph.artist.decider.ArtistDecider
setProxy
 

Constructor Detail

ArtistDeciderBase

protected ArtistDeciderBase()
Creates a new instance of GoogleArtistDecider

Method Detail

newInstance

public static ArtistDeciderBase newInstance()
Only mechanism for getting access to this singleton object.

Returns:
static reference to the underlying class

isArtist

public boolean isArtist(java.lang.String name)
Basic outline of a checked name.

Specified by:
isArtist in interface ArtistDecider
Parameters:
name - string to be checked
Returns:
is it an artist or not, potentially after a lookup (if it is an unchecked string.

lookup

protected abstract void lookup(java.lang.String name)
Overridden to provide a means of determining an artist from a non-artist

Parameters:
name - string to be checked

isChecked

protected boolean isChecked(java.lang.String name)
Has this decider seen this particular string before?

Parameters:
name - name of string
Returns:
has this string been seen before.

output

public void output(java.io.Writer outs)
            throws java.io.IOException
Write this decider to XML.

Specified by:
output in interface ArtistDecider
Parameters:
outs - place to write the data
Throws:
java.io.IOException

addArtist

public void addArtist(java.lang.String a)
Manually adds an artist to the list of known artists

Specified by:
addArtist in interface ArtistDecider
Parameters:
a -

addChecked

public void addChecked(java.lang.String c)
Manually adds to the list of seen artists, but not known artists, effectively labeling it non-artist.

Specified by:
addChecked in interface ArtistDecider
Parameters:
c - non-artist string to be added.