public class TimePattern extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
IMMEDIATE
TimePattern string representing a pattern that always matches
|
static TimePattern |
IMMEDIATE_TIMEPATTERN
TimePattern that matches every instant in time
|
static String |
NEVER
TimePattern string representing a pattern that will never be matched.
|
static TimePattern |
NEVER_TIMEPATTERN
TimePattern that never matches any instant in time
|
static String |
sImmediate
Deprecated.
use IMMEDIATE
|
static String |
sNever
Deprecated.
use NEVER
|
Constructor and Description |
---|
TimePattern(String pattern)
Deprecated.
use valueOf(String) instead
|
Modifier and Type | Method and Description |
---|---|
static TimePattern |
getTimePattern(String tp)
Deprecated.
(use valueOf(String) instead)
|
boolean |
matches(Calendar time)
Determines if this TimePattern has had a match between the specified time, and right now.
|
boolean |
never()
Return whether this timepattern is designed to never match
|
Calendar |
nextMatch(Calendar rangeStart, Calendar rangeEnd)
Get the next match for this TimePattern between the two dates passed in
|
Date |
nextMatch(Date rangeStart, Date rangeEnd)
Get the next match for this TimePattern between the two dates passed in
|
boolean |
now()
Return whether or not this TimePattern matches every instant in time.
|
String |
toString()
Return the string representation of a time pattern
|
static TimePattern |
valueOf(String pattern)
Return an instance of a TimePattern object given the input string specified.
|
public static final String NEVER
public static final String IMMEDIATE
public static final String sNever
public static final String sImmediate
public static final TimePattern NEVER_TIMEPATTERN
public static final TimePattern IMMEDIATE_TIMEPATTERN
public TimePattern(String pattern)
pattern
- time pattern stringIllegalArgumentException
- if the TimePattern is invalidpublic static final TimePattern valueOf(String pattern)
pattern
- TimePattern stringIllegalArgumentException
- if the pattern specified is now well-formed.public static final TimePattern getTimePattern(String tp)
tp
- time pattern stringIllegalArgumentException
- on invalid datapublic String toString()
public boolean never()
public boolean now()
public boolean matches(Calendar time)
time
- The last time this TimePattern had a match.public Date nextMatch(Date rangeStart, Date rangeEnd)
rangeStart
- Find the next match after this daterangeEnd
- Find the next match before this matchpublic Calendar nextMatch(Calendar rangeStart, Calendar rangeEnd)
rangeStart
- Find the next match after this daterangeEnd
- Find the next match before this match