I am making an application which fetches tweets for a specified amount of time, then inserts those tweets in a database and when the user presses another button the top n
words and the hashtags will be shown.
This is my Twitter
package:
[Package]Twitter
>[Class]TwitterTools.java
This is my Analyzing
package:
[Package]Analyzing
>[Class]WordCounting.java
This is the TwitterTools
class:
public class TwitterTools {
public static List<Status> search(Query query) {
}
public static void filterTweetsBasedOnCity(List<Status> tweets, final String city) {
}
public static Query queryMaker(final String keywords, final Date since,
final Date until, final int count) {
}
}
search
- returns a list ofstatus
based on a queryfilterTweetsBasedOnCity
- deletesstatus
from a list if they were not made in a certain cityqueryMaker
- makes a query based on the parameters
This is the WordCounting
class:
public class WordCounting {
public static String getHtmlTable(final List<String[]> words, final List<String[]> hashtags) {
}
public static Stream<Map.Entry<String, Long>> getTopWords(final int topX, final Stream<String> words) {
}
public static String listToHtmlTable(List<Map.Entry<String, Long>> topEntries, final String title) {
}
}
getHtmlTable
- returns the html table of the topX
wordsgetTopWords
- returns a stream of the top wordslistToHtmlTable
- converts a list to an html table
My question is how should I arrange these two packages. Should I merge them since they have only one class each? Should I split them even more by having some of the functions in another class?