|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object GeoSegment ps4.StreetSegment
public class StreetSegment
Class overview to be written by student.
Constructor Summary | |
---|---|
StreetSegment(GeoPoint p1,
GeoPoint p2,
String name,
StreetNumberSet leftNumbers,
StreetNumberSet rightNumbers,
String leftZip,
String rightZip,
StreetClassification streetClass,
boolean increasingAddresses)
Creates a new StreetSegment from the given arguments. |
Method Summary | |
---|---|
double |
fractionDist(int sn)
This method assumes that the locations corresponding to street numbers on this street are spaced evenly apart (regardless of the arithmetic difference between two consecutive street numbers). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StreetSegment(GeoPoint p1, GeoPoint p2, String name, StreetNumberSet leftNumbers, StreetNumberSet rightNumbers, String leftZip, String rightZip, StreetClassification streetClass, boolean increasingAddresses)
p1
- one end of the StreetSegmentp2
- the other end of the StreetSegmentname
- the name of the street of which this is a segmentleftNumbers
- street numbers on the left side of the streetrightNumbers
- street numbers on the right side of the streetleftZip
- ZIP code on the left side of the streetrightZip
- ZIP code on the right side of the streetstreetClass
- StreetClassification of this StreetSegmentincreasingAddresses
- true if addresses increase from p1 to p2
The left and right sides of the street are as viewed from p1 to p2.
Method Detail |
---|
public double fractionDist(int sn)
For instance, if one side of this street contains the street numbers 1, 3, and 99, and this.increasingAddresses is true, then those numbers appear .25, .5, and .75 of the way along the street. If this.increasingAddresses is false, then the numbers appear .75, .5, and .25 of the way along the street.
If both sides of the street have the number sn (which can happen only if the two sides have different Zip codes), then this selects the address on the right-hand side of the street (as viewed from p1).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |