import java.util.*;

/**
 * 创建虚拟的任务的链表
 * **/
public class TaskList
{
	private String taskName;
	private int need_Memory;
	private int time_ms;
	
	private TaskList next;
	
	public TaskList(String taskName,int need_Memory,int time_ms)
	{
		this.taskName = taskName;
		this.need_Memory = need_Memory;
		this.time_ms = time_ms;
		this.next = null;
	}
	
	 public void  setNext(TaskList next)
	 {
		 this.next = next;
	 }
	 
	 public TaskList getNext()
	 {
		 return this.next;
	 }
	 
	 public String get_taskName()
	 {
		 return this.taskName;
	 }
	 
	 public int get_need_Memory()
	 {
		 return this.need_Memory;
	 }
	 //增加节点
	 public void add_TaskList(TaskList new_TaskList)
	 {
		 if(this.next == null)
		 {
			 this.next = new_TaskList;
		 }
		 else
		 {
			 this.next.add_TaskList(new_TaskList);
		 }
	 }
	 //打印节点
	 public void print_TaskList() {
		 
			System.out.println("taskname:"+this.taskName+",needmemory:"+this.need_Memory+",time_ms:"+this.time_ms) ;
			
			if(this.next != null) {
				this.next.print_TaskList();
			}
		}

}
