本文整理汇总了Java中org.cpsolver.exam.model.ExamInstructor.getExams方法的典型用法代码示例。如果您正苦于以下问题:Java ExamInstructor.getExams方法的具体用法?Java ExamInstructor.getExams怎么用?Java ExamInstructor.getExams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cpsolver.exam.model.ExamInstructor
的用法示例。
在下文中一共展示了ExamInstructor.getExams方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAssignedExamsOfInstructor
import org.cpsolver.exam.model.ExamInstructor; //导入方法依赖的package包/类
@Override
public Collection<ExamAssignmentInfo> getAssignedExamsOfInstructor(Long instructorId) {
Lock lock = currentSolution().getLock().readLock();
lock.lock();
try {
ExamInstructor instructor = null;
for (ExamInstructor i: ((ExamModel)currentSolution().getModel()).getInstructors()) {
if (i.getId()==instructorId) {
instructor = i; break;
}
}
if (instructor==null) return null;
Vector<ExamAssignmentInfo> ret = new Vector<ExamAssignmentInfo>();
for (ExamPeriod period: ((ExamModel)currentSolution().getModel()).getPeriods()) {
Set exams = instructor.getExams(currentSolution().getAssignment(), period);
if (exams!=null)
for (Iterator i=exams.iterator();i.hasNext();) {
Exam exam = (Exam)i.next();
ret.add(new ExamAssignmentInfo(currentSolution().getAssignment().getValue(exam), currentSolution().getAssignment()));
}
}
return ret;
} finally {
lock.unlock();
}
}