public class DutySchedule extends Object implements Cloneable
Modifier and Type | Field and Description |
---|---|
static String[] |
DAY_NAMES
A list of names to abbreviate the days of the week
|
static int |
FRIDAY
Constant
FRIDAY=4 |
static int |
MONDAY
A series of constants to identify the days of the week as used by the
DutySchedule class
|
static int |
SATURDAY
Constant
SATURDAY=5 |
static int |
SUNDAY
Constant
SUNDAY=6 |
static int |
THURSDAY
Constant
THURSDAY=3 |
static int |
TUESDAY
Constant
TUESDAY=1 |
static int |
WEDNESDAY
Constant
WEDNESDAY=2 |
Constructor and Description |
---|
DutySchedule()
Create a new DutySchedule.
|
DutySchedule(List<?> aSchedule)
Create a new DutySchedule.
|
DutySchedule(String aSchedule)
Create a new DutySchedule.
|
Modifier and Type | Method and Description |
---|---|
DutySchedule |
clone()
clone
|
Vector<Object> |
getAsVector()
Deprecated.
call the individual getters
|
List<Boolean> |
getDaysAsBooleanList()
Gets the days this DutySchedule is active.
|
int |
getStartTime()
Gets the start time.
|
int |
getStopTime()
Gets the stop time.
|
boolean |
hasDay(int aDay)
hasDay
|
boolean |
isInSchedule(Calendar aTime)
Test if time is contined in schedule.
|
void |
setDay(int aDay)
Sets the day.
|
void |
setEndHour(int anHour)
Sets the stop Hour.
|
void |
setStartHour(int anHour)
Sets the start Hour.
|
String |
toString()
String representation.
|
public static final int MONDAY
public static final int TUESDAY
TUESDAY=1
public static final int WEDNESDAY
WEDNESDAY=2
public static final int THURSDAY
THURSDAY=3
public static final int FRIDAY
FRIDAY=4
public static final int SATURDAY
SATURDAY=5
public static final int SUNDAY
SUNDAY=6
public static final String[] DAY_NAMES
public DutySchedule()
public DutySchedule(List<?> aSchedule)
aSchedule
- Vector filled with 7 Boolean objects and two String objectspublic DutySchedule(String aSchedule)
aSchedule
- the string to convert to a new DutySchedulepublic void setDay(int aDay)
aDay
- the day index to set in the BitSetpublic int getStartTime()
public int getStopTime()
public List<Boolean> getDaysAsBooleanList()
public Vector<Object> getAsVector()
public boolean isInSchedule(Calendar aTime)
aTime
- the time to checkpublic void setStartHour(int anHour)
anHour
- the hour in military time to set the start time for the
DutySchedulepublic void setEndHour(int anHour)
anHour
- the hour in military time to set the end time for the
DutySchedulepublic String toString()
public boolean hasDay(int aDay)
hasDay
aDay
- a int.public DutySchedule clone()
clone
clone
in class Object
DutySchedule
object.Copyright © 2021. All rights reserved.