Skip to content

Commit

Permalink
adding comments to getClosestEvent methods
Browse files Browse the repository at this point in the history
  • Loading branch information
imertetsu committed Aug 14, 2024
1 parent a52c466 commit c4a7c99
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/com/spacecraft/services/PositionService.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ public PositionService(LatitudeService latitudeService,
this.longitudeService = longitudeService;
}

/**
* Finds the closest latitude data point based on the event's occurrence time.
*
* @param eventTime The occurrence time of the event as a string.
* @return The LatitudeDTO corresponding to the closest timestamp, or null if no data is available.
*/
public LatitudeDTO getClosestEventLatitude(String eventTime) {
LocalDateTime eventDateTime = LocalDateTime.parse(eventTime, formatter);

Expand All @@ -33,6 +39,12 @@ public LatitudeDTO getClosestEventLatitude(String eventTime) {
.orElse(null);
}

/**
* Finds the closest longitude data point based on the event's occurrence time.
*
* @param eventTime The occurrence time of the event as a string.
* @return The LongitudeDTO corresponding to the closest timestamp, or null if no data is available.
*/
public LongitudeDTO getClosestEventLongitude(String eventTime){
LocalDateTime eventDateTime = LocalDateTime.parse(eventTime, formatter);

Expand Down

0 comments on commit c4a7c99

Please sign in to comment.