/** * {@inheritDoc} */ @Override public void close() { logMemoryConsumption(Level.FINE); } }
/** * Tests the in-memory implementation. */ @Test public void testInMemory() { testStoreImplementation(new InMemoryNodeLocationStore()); } }
logMemoryConsumption(Level.FINER); writeIntToBuffer( FixedPrecisionCoordinateConvertor.convertToFixed(nodeLocation.getLongitude()), buffer, bufferOffset); bufferOffset += 4; writeIntToBuffer( FixedPrecisionCoordinateConvertor.convertToFixed(nodeLocation.getLatitude()), buffer, bufferOffset); bufferOffset += 4;
int latitude; longitude = readIntFromBuffer(buffer, bufferOffset); bufferOffset += 4; latitude = readIntFromBuffer(buffer, bufferOffset); bufferOffset += 4;
/** * Creates a new instance. * * @param storeType * The type of storage to use for holding node locations. */ public WayGeometryBuilder(NodeLocationStoreType storeType) { if (NodeLocationStoreType.InMemory.equals(storeType)) { locationStore = new InMemoryNodeLocationStore(); } else if (NodeLocationStoreType.TempFile.equals(storeType)) { locationStore = new PersistentNodeLocationStore(); } else if (NodeLocationStoreType.CompactTempFile.equals(storeType)) { locationStore = new CompactPersistentNodeLocationStore(); } else { throw new OsmosisRuntimeException("The store type " + storeType + " is not recognized."); } }