import java.util.*;

/**
 * 创建虚拟的任务的链表
 * **/
public class TaskList
{
	private String taskName;
	public int need_Memory;
	private int time_ms;
	private int priority;
	
	private TaskList next;
	Random s =new Random ();
	
	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;
		this.priority = s.nextInt(4);
	}
	
	 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 int get_time()
	 {
		 return this.time_ms;
	 }
	 //增加节点
	 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();
			}
		}
	 public void print_task()
	 {
		 System.out.println("taskname:"+this.taskName+",needmemory:"+this.need_Memory+",time_ms:"+this.time_ms) ;
			
	 }

}
