public class TimeLocation extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
TimeLocation.IntEnumeration |
Constructor and Description |
---|
TimeLocation(int dayCode,
int startTime,
int length,
int pref,
double normPref,
int datePatternPreference,
Long datePatternId,
String datePatternName,
BitSet weekCode,
int breakTime)
Constructor
|
TimeLocation(int dayCode,
int startTime,
int length,
int pref,
double normPref,
Long datePatternId,
String datePatternName,
BitSet weekCode,
int breakTime) |
Modifier and Type | Method and Description |
---|---|
int |
countDates(int dayOfWeekOffset)
Count how many times this time location is meeting
|
boolean |
equals(Object o) |
int |
getBreakTime() |
Long |
getDatePatternId() |
String |
getDatePatternName() |
int |
getDatePatternPreference() |
TimeLocation.IntEnumeration |
getDates(int dayOfWeekOffset)
List dates when this time location meets.
|
int |
getDayCode()
Days (combination of 1 for Monday, 2 for Tuesday, ...)
|
String |
getDayHeader()
Days for printing purposes
|
TimeLocation.IntEnumeration |
getDays()
Days
|
int[] |
getDaysArray() |
String |
getEndTimeHeader()
Deprecated.
|
String |
getEndTimeHeader(boolean useAmPm)
End time for printing purposes
|
String |
getEndTimeHeaderNoAdj()
Deprecated.
|
String |
getEndTimeHeaderNoAdj(boolean useAmPm)
End time for printing purposes
|
int |
getFirstMeeting(int dayOfWeekOffset) |
int |
getLastMeeting(int dayOfWeekOffset) |
int |
getLength()
Length
|
String |
getLongName()
Deprecated.
|
String |
getLongName(boolean useAmPm) |
String |
getLongNameNoAdj() |
String |
getLongNameNoAdj(boolean useAmPm) |
String |
getName()
Deprecated.
|
String |
getName(boolean useAmPm)
Text representation
|
double |
getNormalizedPreference()
Normalized preference
|
int |
getNrMeetings()
Number of meetings
|
int |
getNrSlotsPerMeeting()
Length
|
int |
getNrWeeks() |
int |
getNrWeeks(int startDay,
int endDay) |
int |
getPreference()
Preference
|
TimeLocation.IntEnumeration |
getSlots()
Used slots
|
int |
getStartSlot()
Start slot
|
TimeLocation.IntEnumeration |
getStartSlots()
Used start slots (for each meeting)
|
String |
getStartTimeHeader()
Deprecated.
|
String |
getStartTimeHeader(boolean useAmPm)
Start time for printing purposes
|
Long |
getTimePatternId()
Time pattern model (can be null)
|
BitSet |
getWeekCode() |
boolean |
hasDate(int date,
int dayOfWeekOffset)
Check if the given time location has a particular date
|
boolean |
hasDay(int day) |
int |
hashCode() |
boolean |
hasIntersection(TimeLocation anotherLocation)
true if overlap
|
int |
nrSharedDays(TimeLocation anotherLocation)
number of overlapping days
|
int |
nrSharedHours(TimeLocation anotherLocation)
number of overlapping time slots (ignoring days)
|
void |
setBreakTime(int breakTime) |
void |
setDatePattern(Long datePatternId,
String datePatternName,
BitSet weekCode) |
void |
setNormalizedPreference(double normalizedPreference) |
void |
setPreference(int preference) |
void |
setTimePatternId(Long timePatternId) |
boolean |
shareDays(TimeLocation anotherLocation)
true if days overlap
|
boolean |
shareHours(TimeLocation anotherLocation)
true if hours overlap
|
boolean |
shareWeeks(BitSet weekCode)
true if weeks overlap
|
boolean |
shareWeeks(TimeLocation anotherLocation)
true if weeks overlap
|
String |
toString() |
public TimeLocation(int dayCode, int startTime, int length, int pref, double normPref, int datePatternPreference, Long datePatternId, String datePatternName, BitSet weekCode, int breakTime)
dayCode
- days (combination of 1 for Monday, 2 for Tuesday, ...)startTime
- start slotlength
- number of slotspref
- time preferencenormPref
- normalized preferencedatePatternPreference
- date pattern preferencedatePatternId
- date pattern unique iddatePatternName
- date pattern nameweekCode
- date pattern (binary string with 1 for each day when classes take place)breakTime
- break time in minutespublic TimeLocation(int dayCode, int startTime, int length, int pref, double normPref, Long datePatternId, String datePatternName, BitSet weekCode, int breakTime)
public int getNrMeetings()
public int getBreakTime()
public void setBreakTime(int breakTime)
public int getDayCode()
public String getDayHeader()
public String getStartTimeHeader(boolean useAmPm)
useAmPm
- use 12-hour format@Deprecated public String getStartTimeHeader()
public String getEndTimeHeader(boolean useAmPm)
useAmPm
- use 12-hour format@Deprecated public String getEndTimeHeader()
public String getEndTimeHeaderNoAdj(boolean useAmPm)
useAmPm
- use 12-hour format@Deprecated public String getEndTimeHeaderNoAdj()
public int getStartSlot()
public boolean shareDays(TimeLocation anotherLocation)
anotherLocation
- another timepublic int nrSharedDays(TimeLocation anotherLocation)
anotherLocation
- another timepublic boolean shareHours(TimeLocation anotherLocation)
anotherLocation
- another timepublic int nrSharedHours(TimeLocation anotherLocation)
anotherLocation
- another timepublic boolean shareWeeks(TimeLocation anotherLocation)
anotherLocation
- another timepublic boolean shareWeeks(BitSet weekCode)
weekCode
- another date patternpublic boolean hasDay(int day)
public boolean hasIntersection(TimeLocation anotherLocation)
anotherLocation
- another timeshareDays(TimeLocation)
, shareHours(TimeLocation)
and shareWeeks(TimeLocation)
are true.public TimeLocation.IntEnumeration getSlots()
public TimeLocation.IntEnumeration getStartSlots()
public TimeLocation.IntEnumeration getDays()
public int[] getDaysArray()
public String getName(boolean useAmPm)
useAmPm
- 12-hour format@Deprecated public String getName()
public String getLongName(boolean useAmPm)
@Deprecated public String getLongName()
public String getLongNameNoAdj(boolean useAmPm)
public String getLongNameNoAdj()
public int getPreference()
public void setPreference(int preference)
public int getLength()
public int getNrSlotsPerMeeting()
public double getNormalizedPreference()
public void setNormalizedPreference(double normalizedPreference)
public Long getTimePatternId()
public Long getDatePatternId()
public void setTimePatternId(Long timePatternId)
public BitSet getWeekCode()
public String getDatePatternName()
public void setDatePattern(Long datePatternId, String datePatternName, BitSet weekCode)
public int getDatePatternPreference()
public int getNrWeeks()
public int getNrWeeks(int startDay, int endDay)
public int getFirstMeeting(int dayOfWeekOffset)
public int getLastMeeting(int dayOfWeekOffset)
public TimeLocation.IntEnumeration getDates(int dayOfWeekOffset)
getWeekCode()
for matching days of the week)public boolean hasDate(int date, int dayOfWeekOffset)
date
- a date, expressed as an index to the getWeekCode()
dayOfWeekOffset
- day of the week offset for the weeks patternpublic int countDates(int dayOfWeekOffset)
dayOfWeekOffset
- day of the week offset for the weeks pattern