bass.dto
Class DTO_BandWithPoints

java.lang.Object
  extended by bass.dto.DTO_Band
      extended by bass.dto.DTO_BandWithPoints
All Implemented Interfaces:
java.lang.Comparable<DTO_BandWithPoints>

public class DTO_BandWithPoints
extends DTO_Band
implements java.lang.Comparable<DTO_BandWithPoints>

DTO_Band extended to point system and referrer list

Version:
0.1
Author:
Thomas Klein

Field Summary
private  java.util.LinkedList<java.lang.String> pointHistory
           
private  int points
           
private  java.util.LinkedList<java.lang.Integer> referrers
           
 
Constructor Summary
DTO_BandWithPoints(java.lang.String name, int id, int initialPoints)
          creates a new DTO
 
Method Summary
 void addPoints(int points)
          adds the specified points to the bands points
 void addToPointHistory(java.lang.String text)
          adds the specified string to the point history
 void addToReferrers(int bandid)
          adds the specified id to the bands referrers
 int compareTo(DTO_BandWithPoints other)
          compares this band to another based on their points
 java.util.LinkedList<java.lang.String> getPointHistory()
           
 java.lang.String getPointHistoryString()
           
 int getPoints()
           
 java.util.LinkedList<java.lang.Integer> getReferrers()
          returns the list of referrers (IDs)
 boolean isReferrer(int bandid)
          checks if the specified band id is a referrer
 void setPointHistory(java.lang.String pointHistoryString)
          generates the point history list from the given string representation
 void setPoints(int points)
          sets the bands points to the specified value, note that old value is overwritten
 
Methods inherited from class bass.dto.DTO_Band
commaRemover, getElementSeperator, getFans, getGenre1, getGenre2, getGenre3, getId, getLabelType, getLastLogin, getLastUpdate, getLocation, getMemberSince, getName, getPlays, getViews, isUsable, setFans, setFans, setGenre1, setGenre2, setGenre3, setId, setLabelType, setLastLogin, setLastLogin, setLastUpdate, setLastUpdate, setLocation, setMemberSince, setMemberSince, setName, setPlays, setPlays, setViews, setViews, stringToDate, toHTML, toServerString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

points

private int points

referrers

private java.util.LinkedList<java.lang.Integer> referrers

pointHistory

private java.util.LinkedList<java.lang.String> pointHistory
Constructor Detail

DTO_BandWithPoints

public DTO_BandWithPoints(java.lang.String name,
                          int id,
                          int initialPoints)
creates a new DTO

Parameters:
name - the bands name
id - the bands id
initialPoints - the initial points for the band
Method Detail

getPoints

public int getPoints()
Returns:
the current points of the bands

setPoints

public void setPoints(int points)
sets the bands points to the specified value, note that old value is overwritten

Parameters:
points - the points to set

addPoints

public void addPoints(int points)
adds the specified points to the bands points

Parameters:
points - the points to add

compareTo

public int compareTo(DTO_BandWithPoints other)
compares this band to another based on their points

Specified by:
compareTo in interface java.lang.Comparable<DTO_BandWithPoints>
See Also:
Comparable.compareTo(java.lang.Object)

getReferrers

public java.util.LinkedList<java.lang.Integer> getReferrers()
returns the list of referrers (IDs)

Returns:
LinkedList with IDs

addToReferrers

public void addToReferrers(int bandid)
adds the specified id to the bands referrers

Parameters:
bandid - the id to add

isReferrer

public boolean isReferrer(int bandid)
checks if the specified band id is a referrer

Parameters:
bandid - the band id to look for
Returns:
true is id is referrer, else false

getPointHistory

public java.util.LinkedList<java.lang.String> getPointHistory()
Returns:
the pointHistory

getPointHistoryString

public java.lang.String getPointHistoryString()
Returns:
a string representation of the point history, single elements are seperated with a ';'

setPointHistory

public void setPointHistory(java.lang.String pointHistoryString)
generates the point history list from the given string representation

Parameters:
pointHistoryString - a point history string generated by the method getPointHistoryString()

addToPointHistory

public void addToPointHistory(java.lang.String text)
adds the specified string to the point history

Parameters:
text - the string to add