Class DateField
- java.lang.Object
-
- org.apache.jackrabbit.core.query.lucene.DateField
-
public class DateField extends Object
ImplementsDate<->Stringconversions in a way that the resultingStringis suitable for indexing and sorting.
-
-
Field Summary
Fields Modifier and Type Field Description static StringMAX_DATE_STRINGReturns 'zzzzzzzzz' -> something around 3189static StringMIN_DATE_STRINGReturns '000000000' -> something around 30 BC
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringdateToString(Date date)Converts a Date to a string suitable for indexing.static DatestringToDate(String s)Converts a string-encoded date into a Date object.static longstringToTime(String s)Converts a string-encoded date into a millisecond time.static StringtimeToString(long time)Converts a millisecond time to a string suitable for indexing.
-
-
-
Method Detail
-
dateToString
public static String dateToString(Date date)
Converts a Date to a string suitable for indexing. This method will throw a RuntimeException if the date specified in the method argument is before 30 BC or after 3189.
-
timeToString
public static String timeToString(long time)
Converts a millisecond time to a string suitable for indexing. Supported date range is: 30 BC - 3189- Throws:
IllegalArgumentException- if the giventimeis not within the supported date range.
-
stringToTime
public static long stringToTime(String s)
Converts a string-encoded date into a millisecond time.
-
-