|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.config.users.DutySchedule
This class holds information on the duty schedules that users can have. Converstion between different formats of the duty schedule information are possible, as is the comparision between a Calendar passed in and the start and stop times of each day in a duty schedule.
Field Summary | |
private static int[] |
CALENDAR_DAY_MAPPING
A mapping between the days of the week as indexed by the DutySchedule class and those of the Calendar class |
static java.lang.String[] |
DAY_NAMES
A list of names to abbreviate the days of the week |
static int |
FRIDAY
|
private java.util.BitSet |
m_days
Each boolean in the bit set represents a day of the week. |
private int |
m_startTime
The starting time of this DutySchedule |
private int |
m_stopTime
The ending time of this DutySchedule |
static int |
MONDAY
A series of constants to identify the days of the week as used by the DutySchedule class |
static int |
SATURDAY
|
static int |
SUNDAY
|
static int |
THURSDAY
|
static int |
TUESDAY
|
static int |
WEDNESDAY
|
Constructor Summary | |
DutySchedule()
Default constructor, builds the BitSet used to identify the days of the week that are set. |
|
DutySchedule(java.lang.String aSchedule)
This constructor is designed to build a new DutySchedule from a String representation formatted as such. |
|
DutySchedule(java.util.Vector aSchedule)
This constructor is designed to convert from a Vector filled with 7 Boolean objects and two String objects into the BitSet and integer start and stop time. |
Method Summary | |
java.util.Vector |
getAsVector()
This method formats the DutySchedule as a vector populated with the first seven objects as Booleans set to indicate what days of the week are stored, and the last two objects as Strings that reflect the start time and stop time respectively. |
private int |
getDayInt(java.lang.String aDay)
This method returns the index value of a day abbreviation |
int |
getStartTime()
This method return the start time as an integer |
int |
getStopTime()
This method return the stop time as an integer |
boolean |
isInSchedule(java.util.Calendar aTime)
This method decides if a given time falls within the duty schedule contained in this object. |
void |
setDay(int aDay)
This method sets the BitSet that tracks what days this DutySchedule applies to. |
void |
setEndHour(int anHour)
This method sets the stop time of this DutySchedule |
void |
setStartHour(int anHour)
This method sets the start time of this DutySchedule |
java.lang.String |
toString()
This method returns the DutySchedule formatted as a string that the DutySchedule(String) constructor could parse. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.util.BitSet m_days
private int m_startTime
private int m_stopTime
public static final int MONDAY
public static final int TUESDAY
public static final int WEDNESDAY
public static final int THURSDAY
public static final int FRIDAY
public static final int SATURDAY
public static final int SUNDAY
public static final java.lang.String[] DAY_NAMES
private static final int[] CALENDAR_DAY_MAPPING
Constructor Detail |
public DutySchedule()
public DutySchedule(java.util.Vector aSchedule)
aSchedule
- filled with 7 Boolean objects and two String objectspublic DutySchedule(java.lang.String aSchedule)
aSchedule
- the string to convert to a new DutyScheduleMethod Detail |
private int getDayInt(java.lang.String aDay)
aDay
- the day abbreviation
public void setDay(int aDay)
aDay
- the day index to set in the BitSetpublic int getStartTime()
public int getStopTime()
public java.util.Vector getAsVector()
public boolean isInSchedule(java.util.Calendar aTime)
aTime
- The time to check.
public void setStartHour(int anHour)
anHour
- The hour in military time to set the start time for the
DutySchedule.public void setEndHour(int anHour)
anHour
- The hour in military time to set the end time for the
DutySchedule.public java.lang.String toString()
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |