在第 3 行中,它显示“找不到符号 - 类 ArrayList”,并突出显示“ArrayList”一词。为了防止他的错误发生,我需要做什么?
任何答案将不胜感激。
请帮助
public class JobQueue
{
private ArrayList<Job>myJob;
private ArrayList<Job>myFinishedJobs;
private int myJobDuration;
private int myTotalDuration;
/**
*
*/
public JobQueue()
{
myJob = new ArrayList<Job>();
myFinishedJobs = new ArrayList<Job>();
myJobDuration =0;
myTotalDuration=0;
}
/**
*
*/
public ArrayList<Job> getPendingJobs()
{
return myJob;
}
/**
*
*/
public ArrayList<Job> getCometedJobs()
{
return myFinishedJobs;
}
/**
*
*/
public Job getCurrentJob()
{
if(myJob!=null)
{
Job FirstJobInTheQueue = myJob.get(0);
return FirstJobInTheQueue;
}
else
{
return null;
}
}
/**
*
*/
public int getClockTime()
{
return myTotalDuration;
}
/**
*
*/
public int getTotalDuration()
{
int totalDuration = 0;
for(int i = 0; i<myJob.size();i++)
{
totalDuration = totalDuration + myJobDuration;
}
return totalDuration;
}
/**
*
*/
public void addJob(Job job)
{
if(job!=null)
{
myJob.add(job);
}
}
/**
*
*/
public void addTime(int seconds)
{
if(seconds>0)
{
myTotalDuration = myTotalDuration + seconds;
}
}
/**
*
*
*/
public boolean runAJob()
{
}
/**
*
*/
public void runAll()
{
}
}