Package it.unipd.dei.eis.core.common
Class Context
- java.lang.Object
-
- it.unipd.dei.eis.core.common.Context
-
public class Context extends Object
The Context class contains the context of the command line.
-
-
Field Summary
Fields Modifier and Type Field Description StringapiKeyThe apiKey field contains the API key.intcountArticlesThe countArticles field contains the number of articles to be retrieved.intcountTermsThe countTerms field contains the number of terms to be extracted.DatefromDateThe fromDate field contains the date from which the articles are retrieved.booleanlemmaThe lemma field contains the boolean value to decide if the terms must be lemmas or not.StringoutputArticlesThe output field contains the articles file name.StringoutputTermsThe output field contains the terms file name.StringqueryThe query field contains the query to be searched.StringsourceThe source field contains the source from which the data are retrieved.DatetoDateThe toDate field contains the limit date to which the articles are retrieved.UseCasesuseCaseThe useCase field contains the UseCase.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ContextfromCommandLine(org.apache.commons.cli.CommandLine cmd)The Context factory constructor.inthashCode()The Context hashCode method.
-
-
-
Field Detail
-
useCase
public final UseCases useCase
The useCase field contains the UseCase.
-
source
public final String source
The source field contains the source from which the data are retrieved.
-
outputArticles
public final String outputArticles
The output field contains the articles file name.
-
outputTerms
public final String outputTerms
The output field contains the terms file name.
-
query
public final String query
The query field contains the query to be searched.
-
countArticles
public final int countArticles
The countArticles field contains the number of articles to be retrieved.
-
countTerms
public final int countTerms
The countTerms field contains the number of terms to be extracted.
-
fromDate
public final Date fromDate
The fromDate field contains the date from which the articles are retrieved.
-
toDate
public final Date toDate
The toDate field contains the limit date to which the articles are retrieved.
-
apiKey
public final String apiKey
The apiKey field contains the API key.
-
lemma
public final boolean lemma
The lemma field contains the boolean value to decide if the terms must be lemmas or not.
-
-
Constructor Detail
-
Context
public Context(UseCases useCase, String source, String outputArticles, String outputTerms, String query, int countArticles, int countTerms, Date fromDate, Date toDate, String apiKey, boolean lemma)
The Context constructor.- Parameters:
useCase- the useCasesource- the sourceoutputArticles- the output articles file nameoutputTerms- the output terms file namequery- the querycountArticles- the number of articles to be retrievedcountTerms- the number of terms to be extractedfromDate- the date from which the articles are retrievedtoDate- the limit date to which the articles are retrievedapiKey- the API keylemma- the boolean value to decide if the terms must be lemmas or not
-
-
Method Detail
-
fromCommandLine
public static Context fromCommandLine(org.apache.commons.cli.CommandLine cmd) throws org.apache.commons.cli.ParseException
The Context factory constructor. It is used to parse the command line.- Parameters:
cmd- the command line- Returns:
- the Context
- Throws:
org.apache.commons.cli.ParseException- if the command line is not valid
-
-