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


Java CurriculumReservation類代碼示例

本文整理匯總了Java中org.cpsolver.studentsct.reservation.CurriculumReservation的典型用法代碼示例。如果您正苦於以下問題:Java CurriculumReservation類的具體用法?Java CurriculumReservation怎麽用?Java CurriculumReservation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: XReservationId

import org.cpsolver.studentsct.reservation.CurriculumReservation; //導入依賴的package包/類
public XReservationId(Reservation reservation) {
	iOfferingId = reservation.getOffering().getId();
	iReservationId = reservation.getId();
	if (reservation instanceof OnlineReservation)
		iType = XReservationType.values()[((OnlineReservation)reservation).getType()];
	else if (reservation instanceof ReservationOverride)
		iType = XReservationType.Override;
	else if (reservation instanceof GroupReservation)
		iType = XReservationType.Group;
	else if (reservation instanceof IndividualReservation)
		iType = XReservationType.Individual;
	else if (reservation instanceof CurriculumReservation)
		iType = XReservationType.Curriculum;
	else if (reservation instanceof CourseReservation)
		iType = XReservationType.Course;
	else
		iType = XReservationType.Dummy;
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:19,代碼來源:XReservationId.java

示例2: type

import org.cpsolver.studentsct.reservation.CurriculumReservation; //導入依賴的package包/類
protected String type(Reservation reservation) {
	if (reservation instanceof GroupReservation) {
		return "group";
    } else if (reservation instanceof ReservationOverride) {
    	return "override";
    } else if (reservation instanceof IndividualReservation) {
        return "individual";
    } else if (reservation instanceof CurriculumReservation) {
    	return "curriculum";
    } else if (reservation instanceof CourseReservation) {
    	return "course";
    } else if (reservation instanceof DummyReservation) {
    	return "dummy";
    } else {
    	return "other";
    }
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:18,代碼來源:UnusedReservations.java

示例3: name

import org.cpsolver.studentsct.reservation.CurriculumReservation; //導入依賴的package包/類
protected String name(Reservation reservation) {
	if (reservation instanceof GroupReservation) {
		return "group";
    } else if (reservation instanceof ReservationOverride) {
    	return "override";
    } else if (reservation instanceof IndividualReservation) {
        return "individual";
    } else if (reservation instanceof CurriculumReservation) {
    	return "curriculum";
    } else if (reservation instanceof CourseReservation) {
    	return "course";
    } else if (reservation instanceof DummyReservation) {
    	return "dummy";
    } else {
    	return "other";
    }
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:18,代碼來源:UnusedReservations.java

示例4: toProto

import org.cpsolver.studentsct.reservation.CurriculumReservation; //導入依賴的package包/類
public static OnlineSectioningLog.Section.Builder toProto(SctAssignment a, Course c, Reservation r) {
OnlineSectioningLog.Section.Builder section = OnlineSectioningLog.Section.newBuilder();
if (a instanceof Section) {
	Section s = (Section)a;
	section.setClazz(
			OnlineSectioningLog.Entity.newBuilder()
			.setUniqueId(s.getId())
			.setExternalId(c == null ? s.getName() : s.getName(c.getId()))
			.setName(s.getName(-1l))
			);
	section.setSubpart(
			OnlineSectioningLog.Entity.newBuilder()
			.setUniqueId(s.getSubpart().getId())
			.setName(s.getSubpart().getName())
			.setExternalId(s.getSubpart().getInstructionalType())
			);
	
	if (s.hasInstructors()) {
		for (Instructor i: s.getInstructors()) {
			OnlineSectioningLog.Entity.Builder instructor = OnlineSectioningLog.Entity.newBuilder()
				.setUniqueId(i.getId())
				.setName(i.getName());
			if (i.getExternalId() != null)
				instructor.setExternalId(i.getExternalId());
			else if (i.getEmail() != null)
				instructor.setExternalId(i.getEmail());
			section.addInstructor(instructor);
		}
	}
}
if (c != null) {
	section.setCourse(
			OnlineSectioningLog.Entity.newBuilder()
			.setUniqueId(c.getId())
			.setName(c.getName()));
}
if (a.getTime() != null) {
	OnlineSectioningLog.Time.Builder time = OnlineSectioningLog.Time.newBuilder();
	time.setDays(a.getTime().getDayCode());
	time.setStart(a.getTime().getStartSlot());
	time.setLength(a.getTime().getLength());
	if (a.getTime().getDatePatternName() != null && !a.getTime().getDatePatternName().isEmpty())
		time.setPattern(a.getTime().getDatePatternName());
	else if (a instanceof FreeTimeRequest)
		time.setPattern("Free Time");
	section.setTime(time);
}
if (a.getRooms() != null) {
	for (RoomLocation room: a.getRooms()) {
		section.addLocation(OnlineSectioningLog.Entity.newBuilder()
				.setUniqueId(room.getId())
				.setName(room.getName())
				);
	}
}
  	if (r != null) {
  		OnlineSectioningLog.Entity.Builder reservation = OnlineSectioningLog.Entity.newBuilder()
  			.setUniqueId(r.getId());
  		if (r instanceof GroupReservation)
  			reservation.setType(OnlineSectioningLog.Entity.EntityType.GROUP_RESERVATION);
  		else if (r instanceof IndividualReservation)
  			reservation.setType(OnlineSectioningLog.Entity.EntityType.INDIVIDUAL_RESERVATION);
  		else if (r instanceof CurriculumReservation) {
  			reservation.setType(OnlineSectioningLog.Entity.EntityType.CURRICULUM_RESERVATION);
  			CurriculumReservation cr = (CurriculumReservation)r;
  			reservation.setName(cr.getAcademicArea() + (cr.getClassifications().isEmpty() ? "" : " " + cr.getClassifications()) + (cr.getMajors().isEmpty() ? "" : cr.getMajors()));
  		} else if (r instanceof CourseReservation)
  			reservation.setType(OnlineSectioningLog.Entity.EntityType.RESERVATION);
  		section.setReservation(reservation);
  	}
  	return section;
  }
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:73,代碼來源:OnlineSectioningHelper.java


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