Skip to content

3. Usage

Parsa Dahesh edited this page Aug 10, 2021 · 9 revisions

Constructor

In order to read the data define and initialize a new variable of MotoGPData:

MotoGPData data = new MotoGPData();

Methods

Session results' methods

List<RiderSession> getSessionResults(Category category, int year, String raceCode, Session session);
List<RiderSession> getSessionResults(Category category, int year, int raceNumber, Session session);

Parameters

Parameter Type Description Example
category Category Category Category.MotoGP
year int Season's year 2019
raceCode String Race code: check Motorsport Stats for the correct one QAT
raceNumber int Race number: starts from 1 1
session Session Session Session.RACE

The racecodes can be found at the bottom of the Motorsport Stats website in the standings' section. Note that the same race might have different racecodes in different seasons.

Standing results' methods

List<RiderStandings> getRidersStandings(...);
List<ConstructorStandings> getConstructorsStandings(...);
List<TeamStandings> getTeamsStandings(...);

Required Parameters

Parameter Type Description Example
category Category Category Category.Moto2
year int Season's year 2010

Optional Parameters to get the standings after a specific grandprix

Parameter Type Description Example
raceCode String Race code: check Motorsport Stats for the correct one QAT
raceNumber int Race number: starts from 1 1

The racecodes can be found at the bottom of the Motorsport Stats website in the standings' section. Note that the same race might have different racecodes in different seasons.

Examples

MotoGPData data = new MotoGPData();

List<RiderSession> raceByRaceCode = data.getSessionResults(Category.MotoGP, 2019, "QAT", Session.RACE);
List<RiderSession> gridByRaceNumber = data.getSessionResults(Category.Moto2, 2015, 8, Session.GRID);

List<ConstructorStandings> constructorsStandings = data.getConstructorStandings(Category.MotoGP, 2010);
List<RiderStandings> ridersStandingsAfterSecondRace = data.getChampionshipStandings(Category.MotoGP, 2019, 2);

Race results example (2019 MotoGP Qatar Grand Prix):

Pos No Rider Nat Team Laps Time (ms)
1 4 Andrea Dovizioso Italy Mission Winnow Ducati 22 2556902
2 93 Marc Márquez Spain Repsol Honda Team 22 2556925
3 35 Cal Crutchlow Great Britain LCR Honda Castrol 22 2557222
4 42 Álex Rins Spain Team Suzuki ECSTAR 22 2557359
5 46 Valentino Rossi Italy Monster Energy Yamaha MotoGP 22 2557502

Riders' standings example (2019 season):

Pos Rider Points Results
1 Marc Márquez 420.0 [20.0, 25.0, 0.0, 25.0, ...]
2 Andrea Dovizioso 269.0 [25.0, 16.0, 13.0, 13.0, ...]
3 Maverick Viñales 211.0 [9.0, 0.0, 5.0, 16.0, ...]
4 Álex Rins 205.0 [13.0, 11.0, 25.0, 20.0, ...]
5 Fabio Quartararo 192.0 [0.0, 8.0, 9.0, 0.0, ...]

Class usage diagram

Clone this wiki locally