us.zuercher.gpx2map.coord.test
Class ConversionsTestCoordLoader
java.lang.Object
us.zuercher.gpx2map.coord.test.ConversionsTestCoordLoader
- All Implemented Interfaces:
- Iterable<ConversionsTestCoordLoader.Equivalence>
public class ConversionsTestCoordLoader
- extends Object
- implements Iterable<ConversionsTestCoordLoader.Equivalence>
ConversionsTestCoordLoader loads test coordinates from a file and provides
an ConversionsTestCoordLoader.EquivIterator
over a disk-based collection of
ConversionsTestCoordLoader.Equivalence
objects. The collection is never loaded into memory as it is quite large.
Currently the format of this file is:
{lat} {lon} northing: {north} easting: {east} zone: {Z} letter: {L}
- Author:
- Stephan Zuercher
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
coordsFile
private final File coordsFile
coordsResource
private final URL coordsResource
ConversionsTestCoordLoader
public ConversionsTestCoordLoader(File coordsFile)
- Construct a ConversionsTestCoordLoader from a given file.
- Parameters:
coordsFile
- file containing a list of equivalent coordinates
ConversionsTestCoordLoader
public ConversionsTestCoordLoader(URL coordsResource)
- Construct a ConversionsTestCoordLoader from a given URL. Typically
the URL is a resource URL, but need not be.
- Parameters:
coordsResource
- URL referring to a list of equivalent coordinates
iterator
public Iterator<ConversionsTestCoordLoader.Equivalence> iterator()
- Returns an iterator over
Equivalence
objects that
represent the entries in the coordinates file or URL used to
construct this class.
- Specified by:
iterator
in interface Iterable<ConversionsTestCoordLoader.Equivalence>
- Returns:
- an Equivalence object Iterator
- Throws:
IllegalStateException
- if there's an error reading the file