當前位置: 首頁>>代碼示例>>Java>>正文


Java Constants.FIRST_SLOT_TIME_MIN屬性代碼示例

本文整理匯總了Java中org.cpsolver.coursett.Constants.FIRST_SLOT_TIME_MIN屬性的典型用法代碼示例。如果您正苦於以下問題:Java Constants.FIRST_SLOT_TIME_MIN屬性的具體用法?Java Constants.FIRST_SLOT_TIME_MIN怎麽用?Java Constants.FIRST_SLOT_TIME_MIN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.cpsolver.coursett.Constants的用法示例。


在下文中一共展示了Constants.FIRST_SLOT_TIME_MIN屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTimeString

public static String getTimeString(int slot, int breakTime) {
       int min = slot * Constants.SLOT_LENGTH_MIN + Constants.FIRST_SLOT_TIME_MIN - breakTime;
       int h = min / 60;
       int m = min % 60;
       if (CFG.useAmPm())
       	return (h > 12 ? h - 12 : h) + ":" + (m < 10 ? "0" : "") + m + (h >= 12 ? "p" : "a");
       else
       	return h + ":" + (m < 10 ? "0" : "") + m;
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:9,代碼來源:OnlineSectioningHelper.java

示例2: time

public static int time(int slot) {
    int s = slot % Constants.SLOTS_PER_DAY;
    int min = (s * Constants.SLOT_LENGTH_MIN + Constants.FIRST_SLOT_TIME_MIN);
    if (min < 450) return 0; // morning
    int idx = 1 + (min - 450) / 60;
    return (idx > 11 ? 11 : idx); // 11+ is evening
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:7,代碼來源:OnlineSectioningTest.java

示例3: getStartTimeHeader

/** Start time for printing purposes
 * @param useAmPm use 12-hour format 
 * @return time header (e.g., 7:30a)
 **/
public String getStartTimeHeader(boolean useAmPm) {
    int min = iStartSlot * Constants.SLOT_LENGTH_MIN + Constants.FIRST_SLOT_TIME_MIN;
    int h = min / 60;
    int m = min % 60;
    if (useAmPm)
        return (h > 12 ? h - 12 : h) + ":" + (m < 10 ? "0" : "") + m + (h >= 12 ? "p" : "a");
    else
        return h + ":" + (m < 10 ? "0" : "") + m;
}
 
開發者ID:UniTime,項目名稱:cpsolver,代碼行數:13,代碼來源:TimeLocation.java

示例4: getEndTimeHeader

/** End time for printing purposes 
 * @param useAmPm use 12-hour format
 * @return end time (e.g., 8:20a)
 **/
public String getEndTimeHeader(boolean useAmPm) {
    int min = (iStartSlot + iLength) * Constants.SLOT_LENGTH_MIN + Constants.FIRST_SLOT_TIME_MIN - getBreakTime();
    int m = min % 60;
    int h = min / 60;
    if (useAmPm)
        return (h > 12 ? h - 12 : h) + ":" + (m < 10 ? "0" : "") + m + (h >= 12 ? "p" : "a");
    else
        return h + ":" + (m < 10 ? "0" : "") + m;
}
 
開發者ID:UniTime,項目名稱:cpsolver,代碼行數:13,代碼來源:TimeLocation.java

示例5: getEndTimeHeaderNoAdj

/** End time for printing purposes 
 * @param useAmPm use 12-hour format
 * @return end time not counting break time (e.g., 8:30a)
 **/
public String getEndTimeHeaderNoAdj(boolean useAmPm) {
    int min = (iStartSlot + iLength) * Constants.SLOT_LENGTH_MIN + Constants.FIRST_SLOT_TIME_MIN;
    int m = min % 60;
    int h = min / 60;
    if (useAmPm)
        return (h > 12 ? h - 12 : h) + ":" + (m < 10 ? "0" : "") + m + (h >= 12 ? "p" : "a");
    else
        return h + ":" + (m < 10 ? "0" : "") + m;
}
 
開發者ID:UniTime,項目名稱:cpsolver,代碼行數:13,代碼來源:TimeLocation.java

示例6: time

/**
 * Return time index in
 * {@link StudentPreferencePenalties#sStudentRequestDistribution} for the
 * given slot.
 * @param slot time slot
 * @return time index
 */
public static int time(int slot) {
    int s = slot % Constants.SLOTS_PER_DAY;
    int min = (s * Constants.SLOT_LENGTH_MIN + Constants.FIRST_SLOT_TIME_MIN);
    if (min < 450)
        return 0; // morning
    int idx = 1 + (min - 450) / 60;
    return (idx > 11 ? 11 : idx); // 11+ is evening
}
 
開發者ID:UniTime,項目名稱:cpsolver,代碼行數:15,代碼來源:StudentPreferencePenalties.java

示例7: slot2time

protected String slot2time(int slot) {
	int minutesSinceMidnight = Constants.SLOT_LENGTH_MIN * slot + Constants.FIRST_SLOT_TIME_MIN;
	return sTwoNumbersDF.format(minutesSinceMidnight / 60) + sTwoNumbersDF.format(minutesSinceMidnight % 60);
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:4,代碼來源:RoomSharingExport.java


注:本文中的org.cpsolver.coursett.Constants.FIRST_SLOT_TIME_MIN屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。