A C D E G H I M N P R S T W

A

addSegment(GeoSegment) - Method in class ps2.GeoFeature
Creates a new GeoFeature that is equal to this GeoFeature with gs appended to its end.
addSegment(GeoSegment) - Method in class ps2.Route
Creates a new route that is equal to this route with gs appended to its end.

C

computeDirections(Route, double) - Method in class ps2.RouteFormatter
Give directions for following this Route, starting at its start point and facing in the specified heading.
computeLine(GeoFeature, double) - Method in class ps2.DrivingRouteFormatter
Computes a single line of a multi-line directions String that represents the instructions for traversing a single geographical feature.
computeLine(GeoFeature, double) - Method in class ps2.RouteFormatter
Computes a single line of a multi-line directions String that represents the intructions for traversing a single geograhpical feature.
computeLine(GeoFeature, double) - Method in class ps2.WalkingRouteFormatter
Computes a single line of a multi-line directions String that represents the instructions for walking along a single geographical feature.

D

distanceTo(GeoPoint) - Method in class ps2.GeoPoint
Computes the distance between GeoPoints.
DrivingRouteFormatter - Class in ps2
The DrivingRouteFormatter class creates a textual description of directions for traversing a route that are suitable for a driver of a vehicle.
DrivingRouteFormatter() - Constructor for class ps2.DrivingRouteFormatter
 
DrivingRouteFormatterTest - Class in ps2.test
Unit tests for the DrivingRouteFormatter class.
DrivingRouteFormatterTest() - Constructor for class ps2.test.DrivingRouteFormatterTest
 

E

equals(Object) - Method in class ps2.GeoFeature
Compares the argument with this GeoFeature for equality.
equals(Object) - Method in class ps2.GeoPoint
Compares the specified Object with this GeoPoint for equality.
equals(Object) - Method in class ps2.GeoSegment
Compares the specified Object with this GeoSegment for equality.
equals(Object) - Method in class ps2.Route
Compares the specified Object with this Route for equality.
example() - Method in class ps2.NullnessExample
 
example() - Method in class ps2.NullnessExampleWithWarnings
 
exampleGenerics() - Method in class ps2.NullnessExample
 
exampleGenerics() - Method in class ps2.NullnessExampleWithWarnings
 

G

GeoFeature - Class in ps2
A GeoFeature represents a path from one location to another along a single geographic feature.
GeoFeature(GeoSegment) - Constructor for class ps2.GeoFeature
Constructs a new GeoFeature.
GeoFeatureTest - Class in ps2.test
Unit tests for the GeoFeature class
GeoFeatureTest() - Constructor for class ps2.test.GeoFeatureTest
 
GeoPoint - Class in ps2
A GeoPoint models a point on the earth.
GeoPoint(int, int) - Constructor for class ps2.GeoPoint
 
GeoPointTest - Class in ps2.test
Unit tests for the GeoPoint class.
GeoPointTest() - Constructor for class ps2.test.GeoPointTest
 
GeoSegment - Class in ps2
A GeoSegment models a straight line segment on the earth.
GeoSegment(String, GeoPoint, GeoPoint) - Constructor for class ps2.GeoSegment
 
GeoSegmentTest - Class in ps2.test
Unit tests for the GeoSegment class.
GeoSegmentTest() - Constructor for class ps2.test.GeoSegmentTest
 
getEnd() - Method in class ps2.GeoFeature
 
getEnd() - Method in class ps2.Route
 
getEndHeading() - Method in class ps2.GeoFeature
 
getEndHeading() - Method in class ps2.Route
 
getEndingGeoSegment() - Method in class ps2.Route
 
getGeoFeatures() - Method in class ps2.Route
Returns a List of GeoFeature objects.
getGeoSegments() - Method in class ps2.GeoFeature
Returns a List of GeoSegment objects.
getGeoSegments() - Method in class ps2.Route
Returns a List of GeoSegment objects.
getHeading() - Method in class ps2.GeoSegment
 
getLatitude() - Method in class ps2.GeoPoint
the latitude of the GeoPoint object, in millionths of degrees.
getLength() - Method in class ps2.GeoFeature
 
getLength() - Method in class ps2.GeoSegment
 
getLength() - Method in class ps2.Route
 
getLongitude() - Method in class ps2.GeoPoint
the longitude of the GeoPoint object, in millionths of degrees.
getName() - Method in class ps2.GeoFeature
 
getName() - Method in class ps2.GeoSegment
 
getP1() - Method in class ps2.GeoSegment
 
getP2() - Method in class ps2.GeoSegment
 
getStart() - Method in class ps2.GeoFeature
 
getStart() - Method in class ps2.Route
 
getStartHeading() - Method in class ps2.GeoFeature
 
getStartHeading() - Method in class ps2.Route
 
getTurnString(double, double) - Method in class ps2.RouteFormatter
Computes directions to turn based on the heading change.

H

hashCode() - Method in class ps2.GeoFeature
 
hashCode() - Method in class ps2.GeoPoint
 
hashCode() - Method in class ps2.GeoSegment
 
hashCode() - Method in class ps2.Route
 
headingTo(GeoPoint) - Method in class ps2.GeoPoint
Computes the compass heading between GeoPoints.

I

ImplementationTests - Class in ps2.test
ImplementationTest is a simple test suite to test the implementation of each problem set.
ImplementationTests() - Constructor for class ps2.test.ImplementationTests
 

M

MAX_LATITUDE - Static variable in class ps2.GeoPoint
Maximum value the latitude field can have in this class.
MAX_LONGITUDE - Static variable in class ps2.GeoPoint
Maximum value the longitude field can have in this class.
MILES_PER_DEGREE_LATITUDE - Static variable in class ps2.GeoPoint
Approximation used to determine distances and headings using a "flat earth" simplification.
MILES_PER_DEGREE_LONGITUDE - Static variable in class ps2.GeoPoint
Approximation used to determine distances and headings using a "flat earth" simplification.
MIN_LATITUDE - Static variable in class ps2.GeoPoint
Minimum value the latitude field can have in this class.
MIN_LONGITUDE - Static variable in class ps2.GeoPoint
Minimum value the longitude field can have in this class.

N

NullnessExample - Class in ps2
This class illustrates use of nullness type annotations.
NullnessExample() - Constructor for class ps2.NullnessExample
 
NullnessExampleWithWarnings - Class in ps2
This class illustrates use of nullness type annotations.
NullnessExampleWithWarnings() - Constructor for class ps2.NullnessExampleWithWarnings
 

P

ps2 - package ps2
 
ps2.test - package ps2.test
 

R

reverse() - Method in class ps2.GeoSegment
Returns a new GeoSegment like this one, but with its endpoints reversed.
Route - Class in ps2
A Route is a path that traverses arbitrary GeoSegments, regardless of their names.
Route(GeoSegment) - Constructor for class ps2.Route
 
RouteFormatter - Class in ps2
A RouteFormatter class knows how to create a textual description of directions from one location to another.
RouteFormatter() - Constructor for class ps2.RouteFormatter
 
RouteTest - Class in ps2.test
Unit tests for the Route class
RouteTest() - Constructor for class ps2.test.RouteTest
 

S

setupBeforeEachTest() - Method in class ps2.test.GeoFeatureTest
 
setupBeforeEachTest() - Method in class ps2.test.GeoSegmentTest
 
setupBeforeEachTest() - Method in class ps2.test.RouteTest
 
setupBeforeTests() - Method in class ps2.test.DrivingRouteFormatterTest
 
setupBeforeTests() - Method in class ps2.test.WalkingRouteFormatterTest
 
SpecificationTests - Class in ps2.test
SpecificationTests is a simple TestSuite that includes and runs all the tests in GeoPointTest, GeoSegmentTest, GeoFeatureTest, RouteTest, WalkingRouteFormatterTest, and DrivingRouteFormatterTest.
SpecificationTests() - Constructor for class ps2.test.SpecificationTests
 

T

testDistance() - Method in class ps2.test.DrivingRouteFormatterTest
Test rounding distance, especially if rounded up to 0.1 and rounded down to 0.0.
testDistance() - Method in class ps2.test.WalkingRouteFormatterTest
Test rounding distance, specifically if it rounds up to 0.1 and rounds down to 0.0.
testDistance01() - Method in class ps2.test.GeoPointTest
Test that distance 0 is handled correctly: same object
testDistance02() - Method in class ps2.test.GeoPointTest
Test that distance 0 is handled correctly: equal objects
testDistanceDueEast() - Method in class ps2.test.GeoPointTest
Test that points due east are handled correctly
testDistanceDueNorth() - Method in class ps2.test.GeoPointTest
Test that points due north are handled correctly
testDistanceDueNorthEast() - Method in class ps2.test.GeoPointTest
Test that points north east are handled correctly
testDistanceDueSouth() - Method in class ps2.test.GeoPointTest
Test that points due south are handled correctly
testDistanceDueSouthWest() - Method in class ps2.test.GeoPointTest
Test that points south west are handled correctly
testDistanceDueWest() - Method in class ps2.test.GeoPointTest
Test that points due west are handled correctly
testEquals1() - Method in class ps2.test.GeoPointTest
Test positive case: same object
testEquals2() - Method in class ps2.test.GeoPointTest
Test positive case: equal objects
testHashCode1() - Method in class ps2.test.GeoPointTest
Test positive case: same object
testHashCode2() - Method in class ps2.test.GeoPointTest
Test positive case: equal objects
testHeadingDueEast() - Method in class ps2.test.GeoPointTest
Test that points due east are handled correctly
testHeadingDueNorth() - Method in class ps2.test.GeoPointTest
Test that points due north are handled correctly
testHeadingDueSouth() - Method in class ps2.test.GeoPointTest
Test that points due south are handled correctly
testHeadingDueWest() - Method in class ps2.test.GeoPointTest
Test that points due west are handled correctly
testHeadingNorthEast() - Method in class ps2.test.GeoPointTest
Test that points north east are handled correctly
testHeadingSouthWest() - Method in class ps2.test.GeoPointTest
Test that points south west are handled correctly
testLegalValues1() - Method in class ps2.test.GeoPointTest
Tests that GeoPoints can be created with some legal latitude and longitude values that are in the greater Seattle area, and that the values it's provided are returned unchanged.
testLegalValues2() - Method in class ps2.test.GeoPointTest
Tests that GeoPoints can be created with some legal latitude and longitude values that are in the greater Seattle area, and that the values it's provided are returned unchanged.
testLegalValuesExtreme() - Method in class ps2.test.GeoPointTest
Tests that GeoPoints can be created with the max/min latitudes and longitudes
testLocationToIntMethod() - Method in class ps2.test.GeoPointTest
Sanity check for our locationToInt() method
testLongRoute() - Method in class ps2.test.DrivingRouteFormatterTest
Long route with no repeats.
testLongRoute() - Method in class ps2.test.WalkingRouteFormatterTest
Long route with no repeats.
testNotEqualsDiff() - Method in class ps2.test.GeoPointTest
Test that two GeoPoints with different data do not register as equal.
testNotEqualsNull() - Method in class ps2.test.GeoPointTest
Test that null values are handled correctly
testNotEqualsSwapped() - Method in class ps2.test.GeoPointTest
Test that two GeoPoints with "swapped" latitude and longitude values (i.e., they both sum to the same value) do not register as equal.
testNotEqualsWrongType() - Method in class ps2.test.GeoPointTest
Test that objects of a different type are handled appropriately
testRepeatedRoute() - Method in class ps2.test.DrivingRouteFormatterTest
Just like long route, but different makeup of geosegements.
testRepeatedRoute() - Method in class ps2.test.WalkingRouteFormatterTest
Just like long route, but different makeup of geosegements.
testRepeatedSegment() - Method in class ps2.test.DrivingRouteFormatterTest
Two step route with one geo feature.
testRepeatedSegment() - Method in class ps2.test.WalkingRouteFormatterTest
Two step route with one geo feature.
testShortDirections() - Method in class ps2.test.DrivingRouteFormatterTest
Test simple directions with one distance and one origHeading.
testShortDirections() - Method in class ps2.test.WalkingRouteFormatterTest
Test simple directions with one distance and one origHeading.
testTurning() - Method in class ps2.test.DrivingRouteFormatterTest
Test turning directions with different origHeadings.
testTurning() - Method in class ps2.test.WalkingRouteFormatterTest
Test turning directions, with different origHeadings.
TestValues - Interface in ps2.test
Interface that contains a constant value for the tolerance that all test cases should use.
TOLERANCE - Static variable in interface ps2.test.TestValues
How close two double values have to be for us to call them equal.
toString() - Method in class ps2.GeoFeature
 
toString() - Method in class ps2.GeoPoint
 
toString() - Method in class ps2.GeoSegment
 
toString() - Method in class ps2.Route
 

W

WalkingRouteFormatter - Class in ps2
A WalkingRouteFormatter class knows how to create a textual description of directions from one location to another suitable for a pedestrian.
WalkingRouteFormatter() - Constructor for class ps2.WalkingRouteFormatter
 
WalkingRouteFormatterTest - Class in ps2.test
Unit tests for the WalkingRouteFormatter class.
WalkingRouteFormatterTest() - Constructor for class ps2.test.WalkingRouteFormatterTest
 

A C D E G H I M N P R S T W