First and foremost, yes, this is an assignment for school.. but before you stop there, let me explain I'm asking for an issue with a bug, not how to do something.
I have a class called CellInfo, that implements CellInfoInterface
class CellInfo
implements CellInfoInterface
{
private String timeTaken;
private int intensity;
private int row;
private int col;
public CellInfo()
{
timeTaken = DATE_TIME_NA;
intensity = NO_DATA;
}
public void updatePosition(int row, int col)
{
this.row = row;
this.col = col;
}
public int getRow()
{
return row;
}
public int getCol()
{
return col;
}
// set the cell's intensity to a new value
public void updateIntensity(int newIntensity)
{
intensity = newIntensity;
}
// set the time the cell's GPR was done to a new value
public void updateTimeTaken(String newTimeTaken)
{
timeTaken = newTimeTaken;
}
// return the cell's intensity
public int getIntensity()
{
return intensity;
}
// return the time the cell's GPR was done
public String getTimeTaken()
{
return timeTaken;
}
public String toString()
{
String str = " " + row + " , " + col + "\t" + intensity + "\t" + timeTaken;
return str;
}
}
And then I do some code like this:
CellInfo c = new CellInfo();
c.getIntensity();
Which should work, and does, for EVERY class/file/method EXCEPT a class called SurveyReport.
Here is the method in SurveyReport that uses the code:
// removes the node with highest priority
public CellInfo pop()
{
System.out.println("POP!");
if(head != null)
{
if(head.next == null)
{
CellInfo e = head.data;
head = null;
size--;
return e;
}
Iterator iter = iterator();
Iterator highest = iterator();
//iter and highest are head node!
CellInfo c = new CellInfo(); //ERROR: Unexpected type on "new CellInfo();
c.getIntensity(); //ERROR: cannot find symbol method
//rest of stuff
Any ideas at all on how to fix this?
I dont understand it AT ALL!