diff options
author | Camil Staps | 2015-04-15 23:09:31 +0200 |
---|---|---|
committer | Camil Staps | 2015-04-15 23:09:31 +0200 |
commit | 2e167b983978f64ccb191dfdddbbac610aade34e (patch) | |
tree | 3a8b0eb064926c3a13f8df229edfe2f247a9c59c /app/src | |
parent | javadoc & optimisation DailyMeditationFragment (diff) |
javadoc DailyReading
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/com/camilstaps/taize/DailyReading.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/app/src/main/java/com/camilstaps/taize/DailyReading.java b/app/src/main/java/com/camilstaps/taize/DailyReading.java index b4ce568..3aa8c54 100644 --- a/app/src/main/java/com/camilstaps/taize/DailyReading.java +++ b/app/src/main/java/com/camilstaps/taize/DailyReading.java @@ -10,7 +10,8 @@ import com.camilstaps.common.Date; import com.camilstaps.common.DatedString; /** - * Created by camilstaps on 7-4-15. + * A daily reading is linked to a Date + * @author Camil Staps */ public class DailyReading extends DatedString { @@ -18,6 +19,10 @@ public class DailyReading extends DatedString { super(date, string); } + /** + * Get the text without the Bible reference on the end + * @return + */ public String getTextWithoutReference() { Matcher bible_ref_m = referenceMatcher(); @@ -28,6 +33,10 @@ public class DailyReading extends DatedString { } } + /** + * Get the Bible reference on the end + * @return + */ public BibleText getBibleReference() { final Matcher bible_ref_m = referenceMatcher(); @@ -42,11 +51,22 @@ public class DailyReading extends DatedString { } } + /** + * A regex matcher to find the Bible reference + * @return + */ private Matcher referenceMatcher() { Pattern bible_ref = Pattern.compile("\\((\\d? ?[a-zA-Z]+) (\\d{1,3})(?::|,)?(\\d+)?-?(\\d+?)?\\)"); return bible_ref.matcher(string); } + /** + * Parse a JSON-encoded DailyReading to a DailyReading + * @param s the JSON-encoded dailyReading + * @return + * @throws JSONException if the string is no valid JSON + * @throws ParseException if the date in the JSON is no valid Date + */ public static DailyMeditation fromString(String s) throws JSONException, ParseException { return (DailyMeditation) DatedString.fromString(s, DailyMeditation.class); } |