test_class.declarator: pointAlongLineDecoder = new PointAlongLineDecoder(new LocationReferencePointDecoder())
test_class.original_string: PointAlongLineDecoder pointAlongLineDecoder = new PointAlongLineDecoder(new LocationReferencePointDecoder());
test_class.type: PointAlongLineDecoder
test_class.var_name: pointAlongLineDecoder
test_class.file: proto/src/test/java/openlr/proto/decoder/PointAlongLineDecoderTest.java
test_class.identifier: PointAlongLineDecoderTest
test_case.body: @Test
      public void testValidLocationReference() throws PhysicalFormatException {
          Coordinates firstCoordinates = Coordinates.newBuilder()
                  .setLongitude(4)
                  .setLatitude(5)
                  .build();
  
          LineAttributes firstLineAttributes = LineAttributes.newBuilder()
                  .setBearing(120)
                  .setFrc(FRC.FRC_3)
                  .setFow(FOW.FOW_SLIPROAD)
                  .build();
  
          PathAttributes firstPathAttributes = PathAttributes.newBuilder()
                  .setDistanceToNext(200)
                  .setLowestFrcAlongPath(FRC.FRC_5)
                  .build();
  
          LocationReferencePoint first = LocationReferencePoint.newBuilder()
                  .setCoordinates(firstCoordinates)
                  .setLineAttributes(firstLineAttributes)
                  .setPathAttributes(firstPathAttributes)
                  .build();
  
          Coordinates lastCoordinates = Coordinates.newBuilder()
                  .setLongitude(4.2)
                  .setLatitude(5.2)
                  .build();
  
          LineAttributes lastLineAttributes = LineAttributes.newBuilder()
                  .setBearing(270)
                  .setFrc(FRC.FRC_1)
                  .setFow(FOW.FOW_MULTIPLE_CARRIAGEWAY)
                  .build();
  
          LocationReferencePoint last = LocationReferencePoint.newBuilder()
                  .setCoordinates(lastCoordinates)
                  .setLineAttributes(lastLineAttributes)
                  .build();
  
          PointAlongLineLocationReference pointAlongLineLocationReference = PointAlongLineLocationReference.newBuilder()
                  .setFirst(first)
                  .setLast(last)
                  .setPositiveOffset(20)
                  .setSideOfRoad(openlr.proto.schema.SideOfRoad.SIDE_OF_ROAD_RIGHT)
                  .setOrientation(openlr.proto.schema.Orientation.ORIENTATION_BOTH)
                  .build();
  
          LocationReferenceData locationReferenceData = LocationReferenceData.newBuilder()
                  .setPointAlongLineLocationReference(pointAlongLineLocationReference)
                  .build();
  
          RawLocationReference rawLocationReference = pointAlongLineDecoder.decode("1", locationReferenceData);
  
          assertNotNull(rawLocationReference);
          assertEquals(rawLocationReference.getID(), "1");
          assertEquals(rawLocationReference.getLocationType(), LocationType.POINT_ALONG_LINE);
  
          List<openlr.LocationReferencePoint> locationReferencePoints = rawLocationReference.getLocationReferencePoints();
          assertNotNull(locationReferencePoints);
          assertEquals(locationReferencePoints.size(), 2);
  
          openlr.LocationReferencePoint firstLrp = locationReferencePoints.get(0);
          assertEquals(firstLrp.getLongitudeDeg(), 4);
          assertEquals(firstLrp.getLatitudeDeg(), 5);
          assertEquals(firstLrp.getBearing(), 120);
          assertEquals(firstLrp.getFRC(), FunctionalRoadClass.FRC_3);
          assertEquals(firstLrp.getFOW(), FormOfWay.SLIPROAD);
          assertEquals(firstLrp.getDistanceToNext(), 200);
          assertEquals(firstLrp.getLfrc(), FunctionalRoadClass.FRC_5);
  
          openlr.LocationReferencePoint lastLrp = locationReferencePoints.get(1);
          assertEquals(lastLrp.getLongitudeDeg(), 4.2);
          assertEquals(lastLrp.getLatitudeDeg(), 5.2);
          assertEquals(lastLrp.getBearing(), 270);
          assertEquals(lastLrp.getFRC(), FunctionalRoadClass.FRC_1);
          assertEquals(lastLrp.getFOW(), FormOfWay.MULTIPLE_CARRIAGEWAY);
  
          Offsets offsets = rawLocationReference.getOffsets();
          assertNotNull(offsets);
          assertEquals(offsets.getPositiveOffset(200),20);
  
          assertEquals(rawLocationReference.getSideOfRoad(), SideOfRoad.RIGHT);
          assertEquals(rawLocationReference.getOrientation(), Orientation.BOTH);
      }
test_case.class_method_signature: PointAlongLineDecoderTest.testValidLocationReference()
test_case.full_signature: @Test public void testValidLocationReference()
test_case.identifier: testValidLocationReference
test_case.invocations: build setLatitude setLongitude newBuilder build setFow setFrc setBearing newBuilder build setLowestFrcAlongPath setDistanceToNext newBuilder build setPathAttributes setLineAttributes setCoordinates newBuilder build setLatitude setLongitude newBuilder build setFow setFrc setBearing newBuilder build setLineAttributes setCoordinates newBuilder build setOrientation setSideOfRoad setPositiveOffset setLast setFirst newBuilder build setPointAlongLineLocationReference newBuilder decode assertNotNull assertEquals getID assertEquals getLocationType getLocationReferencePoints assertNotNull assertEquals size get assertEquals getLongitudeDeg assertEquals getLatitudeDeg assertEquals getBearing assertEquals getFRC assertEquals getFOW assertEquals getDistanceToNext assertEquals getLfrc get assertEquals getLongitudeDeg assertEquals getLatitudeDeg assertEquals getBearing assertEquals getFRC assertEquals getFOW getOffsets assertNotNull assertEquals getPositiveOffset assertEquals getSideOfRoad assertEquals getOrientation
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testValidLocationReference()
focal_class.declarator: locationReferencePointDecoder
focal_class.modifier: private final
focal_class.original_string: private final LocationReferencePointDecoder locationReferencePointDecoder;
focal_class.type: LocationReferencePointDecoder
focal_class.var_name: locationReferencePointDecoder
focal_class.file: proto/src/main/java/openlr/proto/decoder/PointAlongLineDecoder.java
focal_class.identifier: PointAlongLineDecoder
focal_class.interfaces: implements LocationReferenceDecoder
focal_class.class_method_signature: PointAlongLineDecoder.PointAlongLineDecoder(LocationReferencePointDecoder locationReferencePointDecoder)
focal_class.full_signature:   PointAlongLineDecoder(LocationReferencePointDecoder locationReferencePointDecoder)
focal_class.identifier: PointAlongLineDecoder
focal_class.parameters: (LocationReferencePointDecoder locationReferencePointDecoder)
focal_class.signature:  PointAlongLineDecoder(LocationReferencePointDecoder locationReferencePointDecoder)
focal_class.class_method_signature: PointAlongLineDecoder.decode(String id, LocationReferenceData data)
focal_class.full_signature: @Override public RawLocationReference decode(String id, LocationReferenceData data)
focal_class.identifier: decode
focal_class.modifiers: @Override public
focal_class.parameters: (String id, LocationReferenceData data)
focal_class.return: RawLocationReference
focal_class.signature: RawLocationReference decode(String id, LocationReferenceData data)
focal_class.class_method_signature: PointAlongLineDecoder.map(openlr.proto.schema.SideOfRoad sideOfRoad)
focal_class.full_signature: private SideOfRoad map(openlr.proto.schema.SideOfRoad sideOfRoad)
focal_class.identifier: map
focal_class.modifiers: private
focal_class.parameters: (openlr.proto.schema.SideOfRoad sideOfRoad)
focal_class.return: SideOfRoad
focal_class.signature: SideOfRoad map(openlr.proto.schema.SideOfRoad sideOfRoad)
focal_class.class_method_signature: PointAlongLineDecoder.map(openlr.proto.schema.Orientation orientation)
focal_class.full_signature: private Orientation map(openlr.proto.schema.Orientation orientation)
focal_class.identifier: map
focal_class.modifiers: private
focal_class.parameters: (openlr.proto.schema.Orientation orientation)
focal_class.return: Orientation
focal_class.signature: Orientation map(openlr.proto.schema.Orientation orientation)
focal_method.body: @Override
      public RawLocationReference decode(String id, LocationReferenceData data) throws OpenLRProtoException {
          if (!data.hasPointAlongLineLocationReference()) {
              throw new OpenLRProtoException(OpenLRProtoStatusCode.MISSING_LOCATION_REFERENCE);
          }
  
          PointAlongLineLocationReference pointAlongLineLocationReference = data.getPointAlongLineLocationReference();
  
          if (!pointAlongLineLocationReference.hasFirst()) {
              throw new OpenLRProtoException(OpenLRProtoStatusCode.INVALID_LOCATION_REFERENCE);
          }
  
          LocationReferencePoint first = locationReferencePointDecoder.decode(
                  pointAlongLineLocationReference.getFirst(), 1, false);
  
          if (!pointAlongLineLocationReference.hasLast()) {
              throw new OpenLRProtoException(OpenLRProtoStatusCode.INVALID_LOCATION_REFERENCE);
          }
  
          LocationReferencePoint last = locationReferencePointDecoder.decode(
                  pointAlongLineLocationReference.getLast(), 2, true);
  
          Offsets offsets = new OffsetsProtoImpl(pointAlongLineLocationReference.getPositiveOffset());
  
          SideOfRoad sideOfRoad = map(pointAlongLineLocationReference.getSideOfRoad());
          Orientation orientation = map(pointAlongLineLocationReference.getOrientation());
  
          return new RawPointAlongLocRef(id, first, last, offsets, sideOfRoad, orientation);
      }
focal_method.class_method_signature: PointAlongLineDecoder.decode(String id, LocationReferenceData data)
focal_method.full_signature: @Override public RawLocationReference decode(String id, LocationReferenceData data)
focal_method.identifier: decode
focal_method.invocations: hasPointAlongLineLocationReference getPointAlongLineLocationReference hasFirst decode getFirst hasLast decode getLast getPositiveOffset map getSideOfRoad map getOrientation
focal_method.modifiers: @Override public
focal_method.parameters: (String id, LocationReferenceData data)
focal_method.return: RawLocationReference
focal_method.signature: RawLocationReference decode(String id, LocationReferenceData data)