@Test public final void testReducedLineLocation() { LocationReferenceHolder encLocRef = null; LineLocation inputLocation = td.getLineLocationReducibleOffsets(); int lengtIn = 0; for (Line l : inputLocation.getLocationLines()) { lengtIn += l.getLineLength(); } int pOffIn = inputLocation.getPositiveOffset(); int nOffIn = inputLocation.getNegativeOffset(); encLocRef = encodeLocation(inputLocation); assertTrue(encLocRef.isValid()); int lengthOut = 0; for (LocationReferencePoint lrp : encLocRef.getLRPs()) { lengthOut += lrp.getDistanceToNext(); } Offsets offOut = encLocRef.getRawLocationReferenceData().getOffsets(); assertTrue(lengtIn > lengthOut); assertTrue(pOffIn != offOut.getPositiveOffset(0)); assertTrue(nOffIn != offOut.getNegativeOffset(0)); int locationLengthIn = lengtIn - pOffIn - nOffIn; int locationLengthOut = lengthOut - offOut.getPositiveOffset(0) - offOut.getNegativeOffset(0); assertTrue(locationLengthIn == locationLengthOut); }
@Override public LocationReferenceHolder encodeLocation( final OpenLREncoderParameter parameter, final Location loc) throws OpenLRProcessingException { return encodeLocation(parameter, new OpenLREncoderProperties(parameter.getConfiguration(), parameter.getPhysicalEncoders()), loc); }
OpenLREncoder implements openlr.OpenLREncoder { @Override public LocationReferenceHolder encodeLocation( final OpenLREncoderParameter parameter, final Location loc) throws OpenLRProcessingException { return encodeLocation(parameter, new OpenLREncoderProperties(parameter.getConfiguration(), parameter.getPhysicalEncoders()), loc); } }
OpenLREncoder implements openlr.OpenLREncoder { @Override public LocationReferenceHolder encodeLocation( final OpenLREncoderParameter parameter, final Location loc) throws OpenLRProcessingException { return encodeLocation(parameter, new OpenLREncoderProperties(parameter.getConfiguration(), parameter.getPhysicalEncoders()), loc); }  }
OpenLREncoder implements openlr.OpenLREncoder { @Override public LocationReferenceHolder encodeLocation( final OpenLREncoderParameter parameter, final Location loc) throws OpenLRProcessingException { return encodeLocation(parameter, new OpenLREncoderProperties(parameter.getConfiguration(), parameter.getPhysicalEncoders()), loc); }  static List<PhysicalEncoder> getPhysicalEncoderServices(); @Override List<LocationReferenceHolder> encodeLocations(
            final OpenLREncoderParameter parameter, final List<Location> loc); @Override LocationReferenceHolder encodeLocation(
            final OpenLREncoderParameter parameter, final Location loc); @Override String getMajorVersion(); @Override String getMinorVersion(); @Override String getPatchVersion(); @Override String getVersion(); }
OpenLREncoder implements openlr.OpenLREncoder { @Override public LocationReferenceHolder encodeLocation( final OpenLREncoderParameter parameter, final Location loc) throws OpenLRProcessingException { return encodeLocation(parameter, new OpenLREncoderProperties(parameter.getConfiguration(), parameter.getPhysicalEncoders()), loc); }  static List<PhysicalEncoder> getPhysicalEncoderServices(); @Override List<LocationReferenceHolder> encodeLocations(
            final OpenLREncoderParameter parameter, final List<Location> loc); @Override LocationReferenceHolder encodeLocation(
            final OpenLREncoderParameter parameter, final Location loc); @Override String getMajorVersion(); @Override String getMinorVersion(); @Override String getPatchVersion(); @Override String getVersion();  }