Mercurial > dive4elements > river
changeset 4764:1cfda99c024c
DateGuesser: doc.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 04 Jan 2013 11:13:13 +0100 |
parents | 8195396b23ce |
children | 90142c839fe5 |
files | flys-backend/src/main/java/de/intevation/flys/utils/DateGuesser.java |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/utils/DateGuesser.java Fri Jan 04 11:13:02 2013 +0100 +++ b/flys-backend/src/main/java/de/intevation/flys/utils/DateGuesser.java Fri Jan 04 11:13:13 2013 +0100 @@ -68,6 +68,12 @@ return Math.max(Math.min(month-1, 11), 0); } + /** + * Guess date by trying all different patterns. + * Throws IllegalArgumentException if not able to guess. + * @param s The date to be guessed (e.g. 11.02.2001). + * @return the parsed Date. + */ public static Date guessDate(String s) { if (s == null || (s = s.trim()).length() == 0) { throw new IllegalArgumentException();