sectiondetails.java

来自「国外的数据结构与算法分析用书」· Java 代码 · 共 72 行

JAVA
72
字号
package Entities;

import dslib.list.LinkedListUos;

/**	Represents the details of a course section. */
public class SectionDetails
{
	/**	The total number of student allowed in that class */
	protected int limit;

	/**	The time the course is offered */
	protected String timeOffered;
	
	/**	The days the course is offered */
	protected String daysOffered;

	/**	The trem the classes is offered */
	protected int term;

	/**	Make a new course section from the arguments */
	public SectionDetails(int termNum, String time, String day, int limits)
	{
		term = termNum;
		timeOffered = time;
		daysOffered = day;
		limit = limits;
	}

	/**	Set the enrollment limit for this section */
	public void setLimit(int newLimit)
	{
		limit = newLimit;
	}
	
	/**	Return a string representation of the section */
	public String toString()
	{
		String result = "\nTerm : " + term; 
		result += "\nTime : " + timeOffered;
		result += "\nDays : " + daysOffered;
		result += "\nEnrollment Limit : " + limit + "\n";
		return result;
	}
	

	
	/**	Return the total number of student allowed in that class */
	public int limit()
	{
		return limit;
	}
	
	/**	Return tThe time the course is offered */
	public String timeOffered()
	{
		return timeOffered;
	}
	
	/**	Return the days the course is offered */
	public String daysOffered()
	{
		return daysOffered;
	}
	
	/**	Return the trem the classes is offered */
	public int term()
	{
		return term;
	}

} /* end of CourseSection */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?