import java.io.*;
import java.util.Hashtable;
public class ArcInfoReader extends BufferedReader
{
public ArcInfoReader(Reader in)
{
super(in);
ignoreIDs = false;
sequentialID = 0;
}
public void setIgnoreIDs(boolean flag)
{
ignoreIDs = flag;
}
public final synchronized GeoPolygon readGeoPolygon()
throws IOException
{
GeoPolygon poly = null;
int id = 0;
float xcent = 0.0F;
float ycent = 0.0F;
String line = readLine();
String marker = line.substring(0, 3);
if(marker.equals("END"))
return null;
try
{
id = Integer.parseInt(line.substring(4, 10).trim());
if(id != 0xfffe7961)
{
sequentialID++;
if(ignoreIDs)
id = sequentialID;
xcent = (new Float(line.substring(11, 28).trim())).floatValue();
ycent = (new Float(line.substring(29, 44).trim())).floatValue();
}
else
{
id = 0xfffe7961;
xcent = 0.0F;
ycent = 0.0F;
System.out.println("!Null Polygon!");
}
double xpoints[] = new double[500];
double ypoints[] = new double[500];
int npoints = -1;
int limit = 500;
int grow = 20;
do
{
line = readLine();
if(line.substring(0, 3).trim().equals("END"))
break;
if(++npoints >= limit)
{
double xtemp[] = xpoints;
double ytemp[] = ypoints;
xpoints = new double[limit + grow];
ypoints = new double[limit + grow];
limit += grow;
System.arraycopy(xtemp, 0, xpoints, 0, npoints);
System.arraycopy(ytemp, 0, ypoints, 0, npoints);
}
float x = (new Float(line.substring(4, 18).trim())).floatValue();
float y = (new Float(line.substring(19, line.length()).trim())).floatValue();
xpoints[npoints] = x;
ypoints[npoints] = y;
}
while(true);
if(npoints < limit)
{
double xtemp[] = xpoints;
double ytemp[] = ypoints;
xpoints = new double[npoints];
ypoints = new double[npoints];
limit += grow;
System.arraycopy(xtemp, 0, xpoints, 0, npoints);
System






