当前位置: 首页>>代码示例>>Java>>正文


Java CSVField类代码示例

本文整理汇总了Java中org.cpsolver.ifs.util.CSVFile.CSVField的典型用法代码示例。如果您正苦于以下问题:Java CSVField类的具体用法?Java CSVField怎么用?Java CSVField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CSVField类属于org.cpsolver.ifs.util.CSVFile包,在下文中一共展示了CSVField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: csvBuildDatePatternCell

import org.cpsolver.ifs.util.CSVFile.CSVField; //导入依赖的package包/类
@Override
protected CSVField csvBuildDatePatternCell(ClassAssignmentProxy classAssignment, PreferenceGroup prefGroup, boolean isEditable){
   	Assignment a = null;
	if (getDisplayTimetable() && isShowTimetable() && classAssignment!=null && prefGroup instanceof Class_) {
		try {
			a = classAssignment.getAssignment((Class_)prefGroup);
		} catch (Exception e) {
			Debug.error(e);
		}
   	}
   	DatePattern dp = (a != null ? a.getDatePattern() : prefGroup.effectiveDatePattern());
   	CSVField cell = createCell();
   	if (dp!=null) {
		addText(cell, dp.getName(), true);
   	}
       return cell;
   }
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:18,代码来源:CsvClassAssignmentReportListTableBuilder.java

示例2: csvBuildInstructor

import org.cpsolver.ifs.util.CSVFile.CSVField; //导入依赖的package包/类
@Override
protected CSVField csvBuildInstructor(PreferenceGroup prefGroup, boolean isEditable){
	CSVField cell = createCell();
	
	if (prefGroup instanceof Class_) {
		Class_ aClass = (Class_) prefGroup;
		if (aClass.isDisplayInstructor()) {
			TreeSet sortedInstructors = new TreeSet(new InstructorComparator());
        	sortedInstructors.addAll(aClass.getClassInstructors());
    		for (Iterator i=sortedInstructors.iterator(); i.hasNext();) {
    			ClassInstructor ci = (ClassInstructor)i.next();
        		String label = ci.getInstructor().getName(getInstructorNameFormat());
        		addText(cell, label, true);
    		}
		}
	}
	
    return cell;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:20,代码来源:CsvClassAssignmentReportListTableBuilder.java

示例3: csvBuildTimePatternCell

import org.cpsolver.ifs.util.CSVFile.CSVField; //导入依赖的package包/类
private CSVField csvBuildTimePatternCell(PreferenceGroup prefGroup, boolean isEditable){
	CSVField cell = createCell();
	for (Iterator i=prefGroup.effectiveTimePatterns().iterator(); i.hasNext();) {
		TimePattern tp = (TimePattern)i.next();
		addText(cell, tp.getName(), true);  
	}
    if (prefGroup instanceof Class_ && prefGroup.effectiveTimePatterns().isEmpty()) {
    	Class_ clazz = (Class_)prefGroup;
    	DurationModel dm = clazz.getSchedulingSubpart().getInstrOfferingConfig().getDurationModel();
    	Integer ah = dm.getArrangedHours(clazz.getSchedulingSubpart().getMinutesPerWk(), clazz.effectiveDatePattern());
        if (ah == null) {
            addText(cell, "Arr Hrs", true);
        } else {
            addText(cell, "Arr "+ah+" Hrs", true);
        }
    }
    return cell;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:19,代码来源:CsvInstructionalOfferingTableBuilder.java

示例4: csvBuildTimePrefCell

import org.cpsolver.ifs.util.CSVFile.CSVField; //导入依赖的package包/类
private CSVField csvBuildTimePrefCell(ClassAssignmentProxy classAssignment, PreferenceGroup prefGroup, boolean isEditable){
Assignment a = null;
if (getDisplayTimetable() && isShowTimetable() && classAssignment!=null && prefGroup instanceof Class_) {
	try {
		a = classAssignment.getAssignment((Class_)prefGroup);
	} catch (Exception e) {
		Debug.error(e);
	}
  	}
CSVField cell = createCell();
for (Iterator i=prefGroup.effectivePreferences(TimePref.class).iterator(); i.hasNext();) {
	TimePref tp = (TimePref)i.next();
	RequiredTimeTable rtt = tp.getRequiredTimeTable(a == null ? null : a.getTimeLocation());
	addText(cell, rtt.getModel().toString().replaceAll(", ", LINE_SEPARATOR), true);
}
  	return cell;
  }
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:18,代码来源:CsvInstructionalOfferingTableBuilder.java

示例5: csvBuildSnapshotLimit

import org.cpsolver.ifs.util.CSVFile.CSVField; //导入依赖的package包/类
private CSVField csvBuildSnapshotLimit(PreferenceGroup prefGroup, boolean isEditable){
	CSVField cell = createCell();
	if (prefGroup instanceof Class_){
		Class_ aClass = (Class_) prefGroup;
 	boolean unlimited = aClass.getSchedulingSubpart().getInstrOfferingConfig().isUnlimitedEnrollment().booleanValue();
 	if (!unlimited) {
 		String limitString = null;
              if (aClass.getSnapshotLimit()==null) {
            	  limitString = "";
              } else {
                limitString = aClass.getSnapshotLimit().toString();
            }
 		addText(cell, limitString, true);
 	}
	} 
	
    return cell;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:19,代码来源:CsvInstructionalOfferingTableBuilder.java

示例6: csvBuildInstructorAssignment

import org.cpsolver.ifs.util.CSVFile.CSVField; //导入依赖的package包/类
protected CSVField csvBuildInstructorAssignment(PreferenceGroup prefGroup, boolean isEditable){
	CSVField cell = createCell();
	if (prefGroup instanceof Class_) {
		Class_ c = (Class_) prefGroup;
		if (c.isInstructorAssignmentNeeded()) {
			addText(cell, (c.effectiveNbrInstructors() > 1 ? c.effectiveNbrInstructors() + " \u00d7 " : "") +
					Formats.getNumberFormat("0.##").format(c.effectiveTeachingLoad()) + " " + MSG.teachingLoadUnits(), false);
		} else if (c.getSchedulingSubpart().isInstructorAssignmentNeeded()) {
			addText(cell, MSG.cellNoInstructorAssignment(), false);
		}
	} else if (prefGroup instanceof SchedulingSubpart) {
		SchedulingSubpart ss = (SchedulingSubpart)prefGroup;
		if (ss.isInstructorAssignmentNeeded()) {
			addText(cell, (ss.getNbrInstructors() > 1 ? ss.getNbrInstructors() + " \u00d7 " : "") +
					Formats.getNumberFormat("0.##").format(ss.getTeachingLoad()) + " " + MSG.teachingLoadUnits(), false);
		}
	}
	return cell;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:20,代码来源:CsvInstructionalOfferingTableBuilder.java

示例7: csvBuildSchedulePrintNote

import org.cpsolver.ifs.util.CSVFile.CSVField; //导入依赖的package包/类
private CSVField csvBuildSchedulePrintNote(InstructionalOffering io, boolean isEditable, UserContext user){
  	CSVField cell = createCell();

  	StringBuffer note = new StringBuffer("");
Set s = io.getCourseOfferings();
for (Iterator i=s.iterator(); i.hasNext(); ) {
	CourseOffering coI = (CourseOffering) i.next();
	if (coI.getScheduleBookNote()!=null && coI.getScheduleBookNote().trim().length()>0) {
		if (note.length()>0)
			note.append("\n");
		note.append(coI.getScheduleBookNote());
	}
}

addText(cell, note.toString(), true);
      return(cell);
  }
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:18,代码来源:CsvInstructionalOfferingTableBuilder.java

示例8: csvBuildNote

import org.cpsolver.ifs.util.CSVFile.CSVField; //导入依赖的package包/类
protected CSVField csvBuildNote(PreferenceGroup prefGroup, boolean isEditable, UserContext user){
	CSVField cell = createCell();

	if (prefGroup instanceof Class_) {
		Class_ c = (Class_) prefGroup;
		if (c.getNotes()!=null) {
			if (c.getNotes().length() <= 30  || user == null || CommonValues.NoteAsFullText.eq(user.getProperty(UserProperty.ManagerNoteDisplay))){
				addText(cell, c.getNotes(), true);
			} else {
				addText(cell, c.getNotes().substring(0, 30) + "...", true);
			}
		}
	}
	
    return cell;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:17,代码来源:CsvInstructionalOfferingTableBuilder.java

示例9: csvBuildAssignedRoomCapacity

import org.cpsolver.ifs.util.CSVFile.CSVField; //导入依赖的package包/类
private CSVField csvBuildAssignedRoomCapacity(ClassAssignmentProxy classAssignment, PreferenceGroup prefGroup, boolean isEditable) {
	CSVField cell = createCell();

	if (classAssignment!=null && prefGroup instanceof Class_){
		Class_ aClass = (Class_) prefGroup;
		Assignment a = null;
		try {
			a = classAssignment.getAssignment(aClass);
		} catch (Exception e) {
			Debug.error(e);
		}
		if (a!=null) {
			StringBuffer sb = new StringBuffer();
Iterator it2 = a.getRooms().iterator();
while (it2.hasNext()){
	sb.append(((Location) it2.next()).getCapacity());
	if (it2.hasNext()){
					sb.append("\n");
				} 
}
addText(cell, sb.toString(), true);
		}
	}

	return cell;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:27,代码来源:CsvInstructionalOfferingTableBuilder.java

示例10: csvBuildExamPeriod

import org.cpsolver.ifs.util.CSVFile.CSVField; //导入依赖的package包/类
private CSVField csvBuildExamPeriod(ExamAssignmentProxy examAssignment, TreeSet exams, boolean isEditable) {
    StringBuffer sb = new StringBuffer();
    for (Iterator i=exams.iterator();i.hasNext();) {
        Exam exam = (Exam)i.next();
        if (examAssignment!=null && examAssignment.getExamTypeId().equals(exam.getExamType().getUniqueId())) {
            ExamAssignment ea = examAssignment.getAssignment(exam.getUniqueId());
            if (ea==null && !isShowExamName()) continue;
            sb.append(ea==null?"":ea.getPeriodAbbreviation());
        } else {
            if (exam.getAssignedPeriod()==null && !isShowExamName()) continue;
            sb.append(exam.getAssignedPeriod()==null?"":exam.getAssignedPeriod().getAbbreviation());
        }
        if (i.hasNext()) sb.append("\n");
    }
    
    CSVField cell = createCell();
    addText(cell, sb.toString(), true);
    return cell;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:20,代码来源:CsvInstructionalOfferingTableBuilder.java

示例11: csvBuildExamRoom

import org.cpsolver.ifs.util.CSVFile.CSVField; //导入依赖的package包/类
private CSVField csvBuildExamRoom(ExamAssignmentProxy examAssignment, TreeSet exams, boolean isEditable) {
    StringBuffer sb = new StringBuffer();
    for (Iterator i=exams.iterator();i.hasNext();) {
        Exam exam = (Exam)i.next();
        if (examAssignment!=null && examAssignment.getExamTypeId().equals(exam.getExamType().getUniqueId())) {
            ExamAssignment ea = examAssignment.getAssignment(exam.getUniqueId());
            if (ea==null && !isShowExamName()) continue;
            sb.append(ea==null?"":ea.getRoomsName(", "));
        } else {
            if (exam.getAssignedPeriod()==null && !isShowExamName()) continue;
            for (Iterator j=new TreeSet(exam.getAssignedRooms()).iterator();j.hasNext();) {
                Location location = (Location)j.next();
                sb.append(location.getLabel());
                if (j.hasNext()) sb.append(", ");
            }
        }
        if (i.hasNext()) sb.append("\n");
    }
    
    CSVField cell = createCell();
    addText(cell, sb.toString(), true);
    return cell;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:24,代码来源:CsvInstructionalOfferingTableBuilder.java

示例12: csvBuildPrefGroupLabel

import org.cpsolver.ifs.util.CSVFile.CSVField; //导入依赖的package包/类
protected CSVField csvBuildPrefGroupLabel(CourseOffering co, PreferenceGroup prefGroup, String indentSpaces, boolean isEditable, String prevLabel) {
	if (prefGroup instanceof Class_) {
		String label = prefGroup.toString();
    	Class_ aClass = (Class_) prefGroup;
    	label = aClass.getClassLabel(co);
    	if (prevLabel != null && label.equals(prevLabel)){
    		label = "";
    	}
    	CSVField cell = createCell();
    	addText(cell, indentSpaces+label, true);
     InstructionalMethod im = aClass.getSchedulingSubpart().getInstrOfferingConfig().getInstructionalMethod();
     if (aClass.isCancelled()) {
     	if (im != null)
     		addText(cell, " (" + MSG.statusCancelled() + ", " + im.getReference() + ")", false);
     	else
     		addText(cell, " (" + MSG.statusCancelled() + ")", false);
     } else if (im != null)
     	addText(cell, " (" + im.getReference() + ")", false);
    	return cell;
	} else return super.csvBuildPrefGroupLabel(co, prefGroup, indentSpaces, isEditable, null);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:22,代码来源:CsvClassListTableBuilder.java

示例13: csvBuildNote

import org.cpsolver.ifs.util.CSVFile.CSVField; //导入依赖的package包/类
@Override
protected CSVField csvBuildNote(PreferenceGroup prefGroup, boolean isEditable, UserContext user){
	CSVField cell = createCell();

	if (prefGroup instanceof Class_) {
		Class_ c = (Class_) prefGroup;
		String offeringNote = c.getSchedulingSubpart().getInstrOfferingConfig().getInstructionalOffering().getNotes();
		String classNote = c.getNotes();
		String note = (offeringNote == null || offeringNote.isEmpty() ? classNote : offeringNote + (classNote == null || classNote.isEmpty() ? "" : "\n" + classNote));
		if (note != null && !note.isEmpty()) {
			if (note.length() <= 30  || user == null || CommonValues.NoteAsFullText.eq(user.getProperty(UserProperty.ManagerNoteDisplay))){
				addText(cell, note, true);
			} else {
				if (classNote != null && !classNote.isEmpty()) note = classNote;
				addText(cell, (note.length() <= 30 ? note : note.substring(0, 30) + "..."), true);
			}
		}
	}
	
    return cell;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:22,代码来源:CsvClassListTableBuilder.java

示例14: toCSVFile

import org.cpsolver.ifs.util.CSVFile.CSVField; //导入依赖的package包/类
public CSVFile toCSVFile(int ordCol) {
    CSVFile file = new CSVFile();
    if (iHeaders != null) {
        Vector header = new Vector();
        for (int i=0;i<iHeaders.length;i++)
            if (!isFiltered(i))
                header.add(new CSVField(iHeaders[i]==null?"":iHeaders[i]));
        file.setHeader(header);
    }
    boolean asc = (ordCol == 0 || iAsc == null || iAsc.length <= Math.abs(ordCol) - 1 ? true : iAsc[Math.abs(ordCol) - 1]);
    if (ordCol < 0) asc = !asc;
    if (ordCol != 0) Collections.sort(iLines, new WebTableComparator(Math.abs(ordCol) - 1, asc));
    String lastLine[] = new String[Math.max(iColumns,(iHeaders==null?0:iHeaders.length))];
    for (Enumeration el = iLines.elements(); el.hasMoreElements();) {
        WebTableLine wtline = (WebTableLine) el.nextElement();
        String[] line = wtline.getLine();
        Vector cline = new Vector();
        boolean blank = iBlankWhenSame;
        for (int i=0; i<line.length; i++) {
            if (isFiltered(i)) continue;
            if (blank && line[i]!=null && !line[i].equals(lastLine[i])) blank=false;

            cline.add(new CSVField(blank || line[i]==null?"":line[i]));
            lastLine[i] = line[i];
        }
        file.addLine(cline);
    }
    return file;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:30,代码来源:WebTable.java

示例15: csvSubjectAndCourseInfo

import org.cpsolver.ifs.util.CSVFile.CSVField; //导入依赖的package包/类
private CSVField csvSubjectAndCourseInfo(InstructionalOffering io, CourseOffering co) {
	CSVField cell = createCell(co != null ? co.getSubjectAreaAbbv() + " " + co.getCourseNbr() : "");
	InstructionalMethod im = (co != null && co.getInstructionalOffering().getInstrOfferingConfigs().size() == 1 ? co.getInstructionalOffering().getInstrOfferingConfigs().iterator().next().getInstructionalMethod() : null);
    if (!co.isIsControl().booleanValue()) {
    	String managedAs = MSG.crossListManagedAs(io.getControllingCourseOffering().getCourseName());
    	if (im != null) {
    		if (co.getCourseType() != null) {
    			addText(cell, " (" + managedAs + ", " + co.getCourseType().getReference() + ", " + im.getReference() + ")", false);
    		} else {
    			addText(cell, " (" + managedAs + ", " + im.getReference() + ")", false);
    		}
    	} else if (co.getCourseType() != null) {
			addText(cell, " (" + managedAs + ", " + co.getCourseType().getReference() + ")", false);
    	} else {
    		addText(cell, " (" + managedAs + ")", false);
    	}
    } else {
    	if (im != null) {
    		if (co.getCourseType() != null) {
    			addText(cell, " (" + co.getCourseType().getReference() + ", " + im.getReference() + ")", false);
    		} else {
    			addText(cell, " (" + im.getReference() + ")", false);
    		}
    	} else if (co.getCourseType() != null) {
			addText(cell, " (" + co.getCourseType().getReference() + ")", false);
    	}
    }
    for (Iterator it = io.courseOfferingsMinusSortCourseOfferingForSubjectArea(co.getSubjectArea().getUniqueId()).iterator(); it.hasNext(); ) {
    	CourseOffering tempCo = (org.unitime.timetable.model.CourseOffering) it.next();
        addText(cell, indent +tempCo.getSubjectAreaAbbv()+" "+tempCo.getCourseNbr() + " " + (tempCo.getCourseType() != null ? " (" + tempCo.getCourseType().getReference() + ")" : ""), true);
    }
    return cell;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:34,代码来源:CsvInstructionalOfferingTableBuilder.java


注:本文中的org.cpsolver.ifs.util.CSVFile.CSVField类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。