package application.model import java.time.LocalDateTime import java.time.ZoneOffset import java.util.* class Vessel(val mmsi: Int?) { val messages: SortedMap = sortedMapOf() fun getAllTimeInMilliSeconde(): ArrayList { val timeList = arrayListOf() var timeInMilliSeconde: Long messages.forEach { timeInMilliSeconde = it.value.time.value.toEpochSecond(ZoneOffset.UTC).toInt().toLong() timeList.add(timeInMilliSeconde) } return timeList } fun getAllTime(): ArrayList { val timeList = arrayListOf() messages.forEach { timeList.add(it.value.time) } return timeList } fun getAllLatitude(): ArrayList { val latitudeList = arrayListOf() messages.forEach { latitudeList.add(it.value.latitude) } return latitudeList } fun getAllLongitude(): ArrayList { val longitudeList = arrayListOf() messages.forEach { longitudeList.add(it.value.longitude) } return longitudeList } fun getAllSpeedOverGround(): ArrayList { val speedOverGroundList = arrayListOf() messages.forEach { speedOverGroundList.add(it.value.speedOverGround) } return speedOverGroundList } fun getAllCourseOverGround(): ArrayList { val res = arrayListOf() messages.forEach { res.add(it.value.courseOverGround) } return res } fun getAllHeading(): ArrayList { val res = arrayListOf() messages.forEach { res.add(it.value.heading) } return res } fun getAllVesselName(): ArrayList { val res = arrayListOf() messages.forEach { res.add(it.value.vesselName) } return res } fun getAllIMO(): ArrayList { val res = arrayListOf() messages.forEach { res.add(it.value.imo) } return res } fun getAllCallSign(): ArrayList { val res = arrayListOf() messages.forEach { res.add(it.value.callSign) } return res } fun getAllVesselType(): ArrayList { val res = arrayListOf() messages.forEach { res.add(it.value.vesselType) } return res } fun getAllStatus(): ArrayList { val res = arrayListOf() messages.forEach { res.add(it.value.status) } return res } fun getAllLength(): ArrayList { val res = arrayListOf() messages.forEach { res.add(it.value.length) } return res } fun getAllWidth(): ArrayList { val res = arrayListOf() messages.forEach { res.add(it.value.width) } return res } fun getAllDraft(): ArrayList { val res = arrayListOf() messages.forEach { res.add(it.value.draft) } return res } fun getAllCargo(): ArrayList { val res = arrayListOf() messages.forEach { res.add(it.value.cargo) } return res } }