//Construct a polyline from an array of points
public Polyline(Point[] points)
{ //Begin Polyline method
if(points!=null) //Make sure there's an array
{ //Begin if
//Create a one point list
start = new ListPoint(points[0]); //1st point is the start
end = start; //as well as the end

//Add a point object to the list
public void addPoint(Point point)
{
ListPoint newEnd = new ListPoint(point); //Create a new ListPoint
if(start==null)
start=newEnd; //Start is same as end
else
end.setNext(newEnd); //Set next variable for old end as new end
end=newEnd; //Store new point as end
}
}//End if
} //End Polyline method
} //End class