org.musicontroller.core
Class Artist

java.lang.Object
  extended by org.musicontroller.core.Artist
All Implemented Interfaces:
Linkable

public class Artist
extends java.lang.Object
implements Linkable

Implements an artist that performs in songs. Naming conventions for artists:

Version:
$Id: Artist.java,v 1.1 2010/03/16 18:55:42 varienaja Exp $
Author:
varienaja

Constructor Summary
Artist()
           
 
Method Summary
 void addBand(Band band)
           
 boolean equals(java.lang.Object obj)
          Two artists are the same if their names are the same (both first and last names) disregarding case.
 java.util.Set<Contract_BA> getBands()
           
 java.util.Date getBirth()
           
 java.util.Date getChanged()
           
 java.lang.String getComments()
           
 java.util.Date getDecease()
           
 java.lang.String getFirstname()
          Getter for the first name of the artist.
 java.lang.String getFormattedName()
          Returns the artistname in the format "lastname, firstname".
 long getId()
           
 java.util.Date getInserted()
           
 java.lang.String getLastname()
           
 Link getLink()
           
 java.lang.String getName()
          Returns the name of the artist as "firstname lastname".
 java.lang.String getType()
           
 int hashCode()
           
 void setBands(java.util.Set<Contract_BA> bands)
           
 void setBirth(java.util.Date birth)
           
 void setChanged(java.util.Date changed)
           
 void setComments(java.lang.String comments)
           
 void setDecease(java.util.Date decease)
           
 void setFirstname(java.lang.String firstname)
          Setter for the first name of the artist.
 void setId(long id)
           
 void setInserted(java.util.Date inserted)
           
 void setLastname(java.lang.String lastname)
          Setter for the last name of the artist.
 void setLink(Link link)
           
 java.lang.String toString()
          Returns a String representation of the artist suitable for human consumption.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Artist

public Artist()
Method Detail

getBirth

public java.util.Date getBirth()

setBirth

public void setBirth(java.util.Date birth)

getChanged

public java.util.Date getChanged()

setChanged

public void setChanged(java.util.Date changed)

getComments

public java.lang.String getComments()

setComments

public void setComments(java.lang.String comments)

getDecease

public java.util.Date getDecease()

setDecease

public void setDecease(java.util.Date decease)

getLink

public Link getLink()

setLink

public void setLink(Link link)

getId

public long getId()
Specified by:
getId in interface Linkable

setId

public void setId(long id)

getInserted

public java.util.Date getInserted()

setInserted

public void setInserted(java.util.Date inserted)

getLastname

public java.lang.String getLastname()

setLastname

public void setLastname(java.lang.String lastname)
Setter for the last name of the artist. White space gets trimmed. Each artist should have a last name.

Parameters:
lastname - The last name of the artist.

getName

public java.lang.String getName()
Returns the name of the artist as "firstname lastname". The result is "lastname" if the first name part is empty.

Specified by:
getName in interface Linkable
Returns:
The name of the artist.

getBands

public java.util.Set<Contract_BA> getBands()

setBands

public void setBands(java.util.Set<Contract_BA> bands)

addBand

public void addBand(Band band)

getFirstname

public java.lang.String getFirstname()
Getter for the first name of the artist.

Returns:
The first name of the artist.

setFirstname

public void setFirstname(java.lang.String firstname)
Setter for the first name of the artist. Whitespace gets trimmed.

Parameters:
firstname - The new first name.

getFormattedName

public java.lang.String getFormattedName()
Returns the artistname in the format "lastname, firstname". This is suitable for sorted lists of artists. If the first name is empty, this returns "lastname".

Returns:
The formatted name of this Artist

equals

public boolean equals(java.lang.Object obj)
Two artists are the same if their names are the same (both first and last names) disregarding case. (You cannot have two "David Bowies"!)

Overrides:
equals in class java.lang.Object
Returns:
True if the artists are equal, false otherwise.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Returns a String representation of the artist suitable for human consumption.

Overrides:
toString in class java.lang.Object

getType

public java.lang.String getType()
Specified by:
getType in interface Linkable


Copyright © 2010 A.J.V.. All Rights Reserved.