public class WalkerState extends Object
| Constructor and Description |
|---|
WalkerState()
Creates a new WalkerState representing the start of
the next hour from the current time
|
| Modifier and Type | Method and Description |
|---|---|
void |
captureDateTime() |
void |
clearDateGroup()
Clears any date/times that have been captured
|
protected GregorianCalendar |
getCalendar() |
DateGroup |
getDateGroup() |
void |
seekBySpan(String direction,
String seekAmount,
String span)
seeks by a span of time (weeks, months, etc)
|
void |
seekToDayOfMonth(String dayOfMonth)
Seeks to the given day within the current month
|
void |
seekToDayOfWeek(String direction,
String seekType,
String seekAmount,
String dayOfWeek)
seeks to a specified day of the week in the past or future.
|
void |
seekToDayOfYear(String dayOfYear)
Seeks to the given day within the current year
|
void |
seekToHoliday(String holidayString,
String direction,
String seekAmount)
Seeks forward or backwards to a particular holiday based on the current date
|
void |
seekToHolidayYear(String holidayString,
String yearString)
Seeks to the given holiday within the given year
|
void |
seekToMonth(String direction,
String seekAmount,
String month)
seeks to a particular month
|
void |
seekToSeason(String seasonString,
String direction,
String seekAmount)
Seeks forward or backwards to a particular season based on the current date
|
void |
seekToSeasonYear(String seasonString,
String yearString)
Seeks to the given season within the given year
|
void |
seekToYear(String year) |
void |
setDayOfWeekIndex(String index,
String dayOfWeek) |
void |
setDefaultTimeZone(TimeZone zone) |
void |
setExplicitDate(String month,
String dayOfMonth,
String dayOfWeek,
String year) |
void |
setExplicitTime(String hours,
String minutes,
String seconds,
String amPm,
String zoneString)
Sets the the time of day
|
void |
setRecurring() |
public WalkerState()
public void setDefaultTimeZone(TimeZone zone)
public void seekToDayOfWeek(String direction, String seekType, String seekAmount, String dayOfWeek)
direction - the direction to seek: two possibilities
'<' go backward
'>' go forwardseekType - the type of seek to perform (by_day or by_week)
by_day means we seek to the very next occurrence of the given day
by_week means we seek to the first occurrence of the given day week in the
next (or previous,) week (or multiple of next or previous week depending
on the seek amount.)seekAmount - the amount to seek. Must be guaranteed to parse as an integerdayOfWeek - the day of the week to seek to, represented as an integer from
1 to 7 (1 being Sunday, 7 being Saturday.) Must be guaranteed to parse as an Integerpublic void seekToDayOfMonth(String dayOfMonth)
dayOfMonth - the day of the month to seek to, represented as an integer
from 1 to 31. Must be guaranteed to parse as an Integer. If this day is
beyond the last day of the current month, the actual last day of the month
will be used.public void seekToDayOfYear(String dayOfYear)
dayOfYear - the day of the year to seek to, represented as an integer
from 1 to 366. Must be guaranteed to parse as an Integer. If this day is
beyond the last day of the current year, the actual last day of the year
will be used.public void seekToYear(String year)
year - public void seekToMonth(String direction, String seekAmount, String month)
direction - the direction to seek: two possibilities
'<' go backward
'>' go forwardseekAmount - the amount to seek. Must be guaranteed to parse as an integermonth - the month to seek to. Must be guaranteed to parse as an integer
between 1 and 12public void seekBySpan(String direction, String seekAmount, String span)
direction - the direction to seek: two possibilities
'<' go backward
'>' go forwardseekAmount - the amount to seek. Must be guaranteed to parse as an integerspan - public void setDayOfWeekIndex(String index, String dayOfWeek)
index - dayOfWeek - public void setExplicitDate(String month, String dayOfMonth, String dayOfWeek, String year)
month - the month to set. Must be guaranteed to parse as an integer
between 1 and 12dayOfMonth - the day of month to set. Must be guaranteed to parse as an
integer between 1 and 31dayOfWeek - the day of the week. This is optional and will only be used
when no year is given. If the current year's month and day does not fall on the
given day of week, we walk backwards in 1 year iterations until we find the first
such date. If given, must be guaranteed to parse as an integer between 1 and 7.year - the year to set (optional). If present, must be guaranteed to
parse as an integer between 0 and 9999public void setExplicitTime(String hours, String minutes, String seconds, String amPm, String zoneString)
hours - the hours to set. Must be guaranteed to parse as an
integer between 0 and 23minutes - the minutes to set. Must be guaranteed to parse as
an integer between 0 and 59seconds - the optional seconds to set. Must be guaranteed to parse as
an integer between 0 and 59amPm - the meridian indicator to use. Must be either 'am' or 'pm'zoneString - the time zone to use in one of two formats:
- zoneinfo format (America/New_York, America/Los_Angeles, etc)
- GMT offset (+05:00, -0500, +5, etc)public void seekToHoliday(String holidayString, String direction, String seekAmount)
holidayString - The holiday to seek todirection - The direction to seekseekAmount - The number of years to seekpublic void seekToHolidayYear(String holidayString, String yearString)
holidayString - yearString - public void seekToSeason(String seasonString, String direction, String seekAmount)
seasonString - The season to seek todirection - The direction to seekseekAmount - The number of years to seekpublic void seekToSeasonYear(String seasonString, String yearString)
seasonString - yearString - public void setRecurring()
public void captureDateTime()
public DateGroup getDateGroup()
public void clearDateGroup()
protected GregorianCalendar getCalendar()
Copyright © 2015. All rights reserved.