当前位置: 首页>>代码示例>>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;未经允许,请勿转载。