public class PredAccuracyRangeQuery extends PredictionAccuracyQuery
PredictionAccuracyQuery.IntervalsType
Constructor and Description |
---|
PredAccuracyRangeQuery(java.lang.String agencyId)
Creates connection to database specified by the agencyId.
|
PredAccuracyRangeQuery(java.lang.String dbType,
java.lang.String dbHost,
java.lang.String dbName,
java.lang.String dbUserName,
java.lang.String dbPassword)
Creates connection to database.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getJson(java.lang.String beginDateStr,
java.lang.String endDateStr,
java.lang.String beginTimeStr,
java.lang.String endTimeStr,
java.lang.String[] routeIds,
java.lang.String predSource,
java.lang.String predType,
int maxEarlySec,
int maxLateSec)
Performs the query and returns the data in an JSON string so that it can
be used for a chart.
|
static void |
main(java.lang.String[] args)
For debugging
|
public PredAccuracyRangeQuery(java.lang.String dbType, java.lang.String dbHost, java.lang.String dbName, java.lang.String dbUserName, java.lang.String dbPassword) throws java.sql.SQLException
dbType
- dbHost
- dbName
- dbUserName
- dbPassword
- java.sql.SQLException
public PredAccuracyRangeQuery(java.lang.String agencyId) throws java.sql.SQLException
agencyId
- java.sql.SQLException
public java.lang.String getJson(java.lang.String beginDateStr, java.lang.String endDateStr, java.lang.String beginTimeStr, java.lang.String endTimeStr, java.lang.String[] routeIds, java.lang.String predSource, java.lang.String predType, int maxEarlySec, int maxLateSec) throws java.sql.SQLException, java.text.ParseException
beginDateStr
- Begin date for date range of data to use.endDateStr
- End date for date range of data to use. Since want to include
data for the end date, 1 day is added to the end date for the
query.beginTimeStr
- For specifying time of day between the begin and end date to
use data for. Can thereby specify a date range of a week but
then just look at data for particular time of day, such as 7am
to 9am, for those days. Set to null or empty string to use
data for entire day.endTimeStr
- For specifying time of day between the begin and end date to
use data for. Can thereby specify a date range of a week but
then just look at data for particular time of day, such as 7am
to 9am, for those days. Set to null or empty string to use
data for entire day.routeIds
- Specifies which routes to do the query for. Can be null for
all routes or an array of route IDs.predSource
- The source of the predictions. Can be null or "" (for all),
"Transitime", or "Other"predType
- Whether predictions are affected by wait stop. Can be "" (for
all), "AffectedByWaitStop", or "NotAffectedByWaitStop".maxEarlySec
- How early in msec a prediction is allowed to be. Should be a
negative value.maxLateSec
- How late a in msec a prediction is allowed to be. Should be a
positive value.java.sql.SQLException
java.text.ParseException
public static void main(java.lang.String[] args)
args
-