Result:
async getRemoteData(methodId = -1, param = -1) {
if (methodId == -1) {
let rawData = await fetch(this.url1);
let text = await rawData.text();
let array = text.split("\n");
for (let line of array) {
let veri = line.split("\t");
let student = new Student(veri[0], veri[1], veri[2], veri.slice(3));
this.StudentMap.set(veri[0], student);
}
let rawData2 = await fetch(this.url2);
let text2 = await rawData2.text();
let newArray = text2.split("\n");
for (let line2 of newArray) {
let veri2 = line2.split("\t");
let course = new Course(veri2[0], veri2[1], veri2[2], veri2.slice(3));
this.CourseMap.set(veri2[0], course);
}
}
if (param != -1) {
if (methodId == 1) {
this.NumberOfStudentsAboveGPA(param);
} else if (methodId == 2) {
this.CoursesTakenByStudent(param);
} else if (methodId == 3) {
this.ExamSchedule(param);
} else if (methodId == 4) {
this.StudentList(param);
} else if (methodId == 5) {
this.CourseList(param);
} else if (methodId == 6) {
this.NumberOfCourses(param);
} else if (methodId == 7) {
this.CoursesInDate(param);
}
} else if (methodId == 0) {
this.RandomStd();
}
}