Package com.actelion.research.util
Class DateAnalysis
- java.lang.Object
-
- com.actelion.research.util.DateAnalysis
-
public class DateAnalysis extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description DateAnalysis()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
analyse(java.lang.String entry)
Checks, whether entry consists of three elements separated by one or more non-word characters (neither digit nor letter) that might be day, month and year.float
getDateFloat(java.lang.String entry)
long
getDateMillis(java.lang.String entry)
static int
interpreteMonth(java.lang.String item)
boolean
isConclusive()
Call this only once after calling analyse() once or multiple times.
-
-
-
Method Detail
-
analyse
public boolean analyse(java.lang.String entry)
Checks, whether entry consists of three elements separated by one or more non-word characters (neither digit nor letter) that might be day, month and year.- Parameters:
entry
-- Returns:
- false if entry cannot be a date
-
isConclusive
public boolean isConclusive()
Call this only once after calling analyse() once or multiple times. If this method returns true, then you can use this object to interpret date strings of same format with getDateMillis(), e.g. the one passed with analyse().- Returns:
-
getDateMillis
public long getDateMillis(java.lang.String entry)
-
getDateFloat
public float getDateFloat(java.lang.String entry)
-
interpreteMonth
public static int interpreteMonth(java.lang.String item)
-
-