|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbass.db.DB_Conn
public class DB_Conn
Provides several methods to fill the database
| Constructor Summary | |
|---|---|
DB_Conn()
|
|
| Method Summary | |
|---|---|
static void |
deleteBand(int bandId)
Deletes a band from the bands table |
static void |
generateFriendsPerDayFile()
|
static void |
getActivityCurveData()
Gets the registration dates for every band and the amount of bands registrated at those dates, writing them into a .txt file. |
static org.jfree.data.time.TimeSeriesCollection |
getActivityCurveData(Gui theGui)
Gets the data from both activity .txt files to creates 2 timelines. |
static int |
getBandAmount()
Deprecated. |
static int[] |
getBandIDs()
|
static java.lang.String |
getBandname(int id)
Deprecated. not used anymore |
static java.util.Hashtable<java.lang.Integer,DTO_BandWithPoints> |
getBandsOnFLists(DTO_Band[] ids,
int points,
java.util.Hashtable<java.lang.Integer,DTO_BandWithPoints> scoreList,
Gui theGui)
scans the friendlists of the specified bands for other bands and returns a hashtable with the new found bands, if you want to insert them in an existing hashtable use the param scorelist |
static void |
getFriendData(BassNodeList friends)
Get the additional data out of the db for the depth2 friends (friends of a friend in the mainbands friendlist) |
static void |
getGenreFrequencyData()
Getting the genre data (how many bands in each genre) out of the database and writing it into a .txt file for further use. |
static org.jfree.data.category.DefaultCategoryDataset |
getGenreFrequencyData(Gui theGui,
java.lang.String mode)
Reading the genre Data out of two .txt files and generating a dataset with it. |
static void |
getGenreGrowthData()
Gets the registration dates for every band and groups them by genres (considering genre1-3). |
static org.jfree.data.time.TimeSeriesCollection |
getGenreGrowthData(Gui theGui,
java.lang.String[] genreArray)
Reads the registrations dates for the genres given by the array from a .txt file and uses the data to generate a dataset |
static void |
getHypeCurveData()
Gets the registration dates for every band and and the amount of bands that registered on the particular date. |
static org.jfree.data.time.TimeSeriesCollection |
getHypeCurveData(Gui theGui)
Reads the registration dates and their amount of bands from a .txt file and generates a dataset |
static void |
getLabelTypeData()
Gets the label type from every band in the database, counts them and writes the data into a text file |
static org.jfree.data.general.DefaultPieDataset |
getLabelTypeData(Gui theGui)
Deprecated. not used, because the pie chart got kicked out of the label type chart |
static void |
getLabelTypePerGenreData()
Gets the percentages of the 3 different label types for every genre and the general percentages for all genres, Considering genre1-3. |
static org.jfree.data.category.DefaultCategoryDataset |
getLabelTypePerGenreData(Gui theGui,
java.lang.String mode)
Gets the label type percentages from a .txt file and generates a DefaultCategoryDataset |
static org.jfree.data.general.DefaultPieDataset |
getLongTailData(Gui theGui)
Deprecated. |
static org.jfree.data.general.DefaultPieDataset |
getLongTailDataHardCoded(Gui theGui)
Using the hardcoded values (amount of bands grouped by their amount of fans) to create the dataset for a standard pie chart. |
static DTO_BandWithFPD[] |
getTopBands(Gui theGui,
int rankMode,
java.lang.String genre)
Reads the Top 100 Bands (or less if there are not 100 bands for the specific ranking) for 1 of the 5 ranking methods (by fans, plays, views, membership and friends per day) and creates an array of DTO_BandWithFPD |
static java.util.LinkedList<DTO_Band> |
searchBands(java.lang.String searchString,
boolean exactSearch)
searches the db for bandnames including the specified string |
static java.util.LinkedList<DTO_BandnameWithFList> |
selectBandWithFriends1(java.lang.String mainBand,
int minFriends,
int depth,
Gui theGui)
Get the band out of the DB including the friends that are connected (first level friends only) |
static void |
writeProfilesToDb(java.util.LinkedList<DTO_Profile> profiles)
updates the band data with the data parsed from profiles |
static void |
writeToDb(DTO_Band band)
Generates a query and executes it to write the specific band data into the database (crawler usuage) |
static void |
writeToDb(DTO_FList flist)
writes the given friendlist to the db |
static void |
writeToDb(java.util.LinkedList<DTO_Band> bands)
Iterates the given list of DTOs and writes them to the db (crawler usuage) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DB_Conn()
| Method Detail |
|---|
public static void writeToDb(DTO_Band band)
band - public static void writeToDb(java.util.LinkedList<DTO_Band> bands)
bands - the band listpublic static int[] getBandIDs()
public static void writeToDb(DTO_FList flist)
flist - the friendlist ...
(crawler usuage)public static void writeProfilesToDb(java.util.LinkedList<DTO_Profile> profiles)
profiles - a list of profile data DTO's
(crawler usuage)
public static java.util.LinkedList<DTO_BandnameWithFList> selectBandWithFriends1(java.lang.String mainBand,
int minFriends,
int depth,
Gui theGui)
mainBand: - the band the user want to visualizeminFriends: - the user selected minimum amount of friends (included the nonbands) of the target band (and it's friends)
LinkedList of the type DTO_BandnameWithFListpublic static void getFriendData(BassNodeList friends)
mainBand: - the band the user want to visualizeminFriends: - the user selected minimum amount of friends (included the nonbands) of the target band (and it's friends)public static org.jfree.data.general.DefaultPieDataset getLongTailData(Gui theGui)
theGui - used for (re)setting the Gui's progress bar
public static org.jfree.data.general.DefaultPieDataset getLongTailDataHardCoded(Gui theGui)
theGui - used for (re)setting the Gui's progress bar
DefaultPieDataset the generated dataset to create a pie chart
out of the gathered datapublic static void getGenreFrequencyData()
public static org.jfree.data.category.DefaultCategoryDataset getGenreFrequencyData(Gui theGui,
java.lang.String mode)
theGui - used for (re)setting the Gui's progress barmode - used to determine how the genres should be ordererd (which .txt files to use)
"all" for all crawled bands or "used" for the bands we finally used for our project
DefaultCategoryDataset the generated dataset to create a chart
public static java.util.LinkedList<DTO_Band> searchBands(java.lang.String searchString,
boolean exactSearch)
searchString - word(s) to search for
public static java.util.Hashtable<java.lang.Integer,DTO_BandWithPoints> getBandsOnFLists(DTO_Band[] ids,
int points,
java.util.Hashtable<java.lang.Integer,DTO_BandWithPoints> scoreList,
Gui theGui)
ids - ths list of bands id's whose friendlists should be scannedpoints - points to give to the found bandsscoreList - if this param is not null new found bands will be inserted here, if you leave it null
a new hashtable will be createdtheGui - the refernce to the gui, so progressbar etc can be set
Hashtablepublic static int getBandAmount()
public static void getGenreGrowthData()
public static org.jfree.data.time.TimeSeriesCollection getGenreGrowthData(Gui theGui,
java.lang.String[] genreArray)
theGui - used for (re)setting the progress bargenreArray - an array of genres for which the time data will be considered
TimeSeriesCollection - the generated dataset to create a chartpublic static java.lang.String getBandname(int id)
id - the band id
public static void getLabelTypeData()
public static org.jfree.data.general.DefaultPieDataset getLabelTypeData(Gui theGui)
theGui -
public static void getLabelTypePerGenreData()
public static org.jfree.data.category.DefaultCategoryDataset getLabelTypePerGenreData(Gui theGui,
java.lang.String mode)
DefaultCategoryDataset
theGui - used for (re)setting the progress barmode - used to switch between 2 possible ways of sorting the genres
("alpha" -> alphabetical, "freq" -> popularity/frequency)
DefaultCategoryDataset - the generated dataset to create a chartpublic static void getHypeCurveData()
public static org.jfree.data.time.TimeSeriesCollection getHypeCurveData(Gui theGui)
theGui - used for (re)setting the progress bar
TimeSeriesCollection - the generated dataset to create a chartpublic static void getActivityCurveData()
public static org.jfree.data.time.TimeSeriesCollection getActivityCurveData(Gui theGui)
theGui - used for (re)setting the progress bar
TimeSeriesCollection - the generated dataset to create a chartpublic static void deleteBand(int bandId)
bandId -
public static DTO_BandWithFPD[] getTopBands(Gui theGui,
int rankMode,
java.lang.String genre)
theGui - - used for (re)setting the progess abrrankMode - - the kind of ranking used (fans,plays,views,membership,friends per day)genre - - the selected genre
public static void generateFriendsPerDayFile()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||