|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectps6.StreetSegReader
public class StreetSegReader
A StreetSegReader reads StreetSegments from a set of Tiger Databases.
Tiger Databases are produced and maintained by the U.S. Census Bureau.
Tiger Databases are distributed in zip-compressed files. To
allow for the loading of an arbitrary number of these databases,
one creates each StreetSegReader with a source directory argument,
which will then be searched for Tiger Database files when
streetSegments()
is called. The subdirectories of the
argument directory are not searched recursively for Tiger files as
well; only the immediate contents of this.sourceDirectory will be
considered as potential Tiger files.
StreetSegReader is only specified to operate correctly with directories that contain no .zip files besides the Tiger Databases. Files with other extensions (such as .pdf) will not affect the operation of StreetSegReader, but no other .zip files should be kept in the source directory for a StreetSegReader.
sourceDirectory
- : String // name of directory where Tiger files are located
streetSegs
- : Collection // contents of the database; each element is a StreetSegment
Nested Class Summary | |
---|---|
static class |
StreetSegReader.InvalidSourceException
Exception indicating that the requested source for a tiger database is invalid |
Constructor Summary | |
---|---|
StreetSegReader(String sourceDirectory)
|
Method Summary | |
---|---|
Iterator<StreetSegment> |
iterator()
Returns an Iterator over this.streetSegs. |
Iterator<StreetSegment> |
streetSegments()
Returns an Iterator over this.streetSegs. |
protected StreetSegIterator |
streetSegmentsInternal()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StreetSegReader(String sourceDirectory) throws StreetSegReader.InvalidSourceException
StreetSegReader.InvalidSourceException
- if sourceDirectory is not valid
database (most directories, even empty ones, count as valid).Method Detail |
---|
public Iterator<StreetSegment> iterator()
protected StreetSegIterator streetSegmentsInternal()
public Iterator<StreetSegment> streetSegments()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |