From 5df9b03e7c119a2d250b59b1735663d2cdff6c49 Mon Sep 17 00:00:00 2001 From: Don Cross Date: Mon, 2 May 2022 13:38:31 -0400 Subject: [PATCH] Added comments to Java demos. --- demo/java/demotest | 2 +- .../io/github/cosinekitty/astronomy/demo/MoonPhase.java | 7 +++++++ .../io/github/cosinekitty/astronomy/demo/Positions.java | 2 +- .../java/io/github/cosinekitty/astronomy/demo/Seasons.java | 6 ++++++ demo/kotlin/demotest | 2 +- demo/kotlin/src/main/kotlin/MoonPhase.kt | 2 +- demo/kotlin/src/main/kotlin/Seasons.kt | 2 +- 7 files changed, 18 insertions(+), 5 deletions(-) diff --git a/demo/java/demotest b/demo/java/demotest index 94be3d52..d7e4a2b4 100755 --- a/demo/java/demotest +++ b/demo/java/demotest @@ -23,5 +23,5 @@ TestDemo moonphase 2019-06-15T09:15:32.987Z TestDemo positions +45.6 -90.7 2018-11-30T17:55:07.234Z TestDemo seasons 2019 -echo "PASS: Java demos" +echo "Java demos: PASS" exit 0 diff --git a/demo/java/src/main/java/io/github/cosinekitty/astronomy/demo/MoonPhase.java b/demo/java/src/main/java/io/github/cosinekitty/astronomy/demo/MoonPhase.java index 918e41e6..6db55dee 100644 --- a/demo/java/src/main/java/io/github/cosinekitty/astronomy/demo/MoonPhase.java +++ b/demo/java/src/main/java/io/github/cosinekitty/astronomy/demo/MoonPhase.java @@ -2,6 +2,13 @@ package io.github.cosinekitty.astronomy.demo; import io.github.cosinekitty.astronomy.*; public class MoonPhase { + /** + * Display Moon phase information and the next 10 quarter phases. + * + * @param time + * The date and time for which to display Moon phase information, + * and when to initiate a search for the subsequent quarter phases. + */ public static int run(Time time) { // Calculate the Moon's ecliptic phase angle, // which ranges from 0 to 360 degrees. diff --git a/demo/java/src/main/java/io/github/cosinekitty/astronomy/demo/Positions.java b/demo/java/src/main/java/io/github/cosinekitty/astronomy/demo/Positions.java index d45e3c8e..306799f4 100644 --- a/demo/java/src/main/java/io/github/cosinekitty/astronomy/demo/Positions.java +++ b/demo/java/src/main/java/io/github/cosinekitty/astronomy/demo/Positions.java @@ -8,7 +8,7 @@ public class Positions { }; /** - * Display equatorial and horizontal coordinates of solar system bodies. + * Print a table of solar system body positions in equatorial and horizontal coordinates. * * @param observer * The geographic location for which to calculate positions. diff --git a/demo/java/src/main/java/io/github/cosinekitty/astronomy/demo/Seasons.java b/demo/java/src/main/java/io/github/cosinekitty/astronomy/demo/Seasons.java index 77160892..e9a289f1 100644 --- a/demo/java/src/main/java/io/github/cosinekitty/astronomy/demo/Seasons.java +++ b/demo/java/src/main/java/io/github/cosinekitty/astronomy/demo/Seasons.java @@ -2,6 +2,12 @@ package io.github.cosinekitty.astronomy.demo; import io.github.cosinekitty.astronomy.*; public class Seasons { + /** + * Print the times of the equinoxes and solstices for a calendar year. + * + * @param year + * The calendar year value for which to find equinoxes and solstices. + */ public static int run(int year) { SeasonsInfo seasons = Astronomy.seasons(year); System.out.printf("March equinox : %s%n", seasons.getMarchEquinox()); diff --git a/demo/kotlin/demotest b/demo/kotlin/demotest index a8e24dcd..7386da94 100755 --- a/demo/kotlin/demotest +++ b/demo/kotlin/demotest @@ -7,7 +7,7 @@ Fail() TestDemo() { - echo "Testing: $1" + echo "Testing Kotlin demo: $1" ./rundemo $* > test/$1.txt || Fail "Error running demo: $1" diff {correct,test}/$1.txt || Fail "Incorrect output: $1" } diff --git a/demo/kotlin/src/main/kotlin/MoonPhase.kt b/demo/kotlin/src/main/kotlin/MoonPhase.kt index 6f9e958d..cde74b78 100644 --- a/demo/kotlin/src/main/kotlin/MoonPhase.kt +++ b/demo/kotlin/src/main/kotlin/MoonPhase.kt @@ -1,7 +1,7 @@ import io.github.cosinekitty.astronomy.* /** - * Displays Moon phase information and predicts the next 10 quarter phases. + * Display Moon phase information and the next 10 quarter phases. * * @param time * The date and time for which to display Moon phase information, diff --git a/demo/kotlin/src/main/kotlin/Seasons.kt b/demo/kotlin/src/main/kotlin/Seasons.kt index 46b26b2a..6dd1ebf6 100644 --- a/demo/kotlin/src/main/kotlin/Seasons.kt +++ b/demo/kotlin/src/main/kotlin/Seasons.kt @@ -1,7 +1,7 @@ import io.github.cosinekitty.astronomy.* /** - * Demonstration of calculating the equinoxes and solstices for calendar year. + * Print the times of the equinoxes and solstices for a calendar year. * * @param year * The calendar year value for which to find equinoxes and solstices.