/** * Creates a new instance. */ public PersistentNodeLocationStore() { stage = StorageStage.NotStarted; lastNodeId = Long.MIN_VALUE; zeroBuffer = new byte[ZERO_BUFFER_SIZE]; Arrays.fill(zeroBuffer, (byte) 0); invalidNodeLocation = new NodeLocation(); }
/** * Creates a new instance. */ public InMemoryNodeLocationStore() { buffers = new ArrayList<byte[]>(); invalidNodeLocation = new NodeLocation(); }
/** * Creates a new instance. * * @param sr * The store to read state from. * @param scr * Maintains the mapping between classes and their identifiers within the store. */ public CompactPersistentNodeLocation(StoreReader sr, StoreClassRegister scr) { nodeLocation = new NodeLocation(sr.readDouble(), sr.readDouble()); }
/** * Adds the location of the node to the internal store. * * @param node * The node to add. */ public void addNodeLocation(Node node) { locationStore.addLocation(node.getId(), new NodeLocation(node.getLongitude(), node.getLatitude())); }
bufferOffset += 4; nodeLocation = new NodeLocation( FixedPrecisionCoordinateConvertor.convertToDouble(longitude), FixedPrecisionCoordinateConvertor.convertToDouble(latitude)
nodeLocation = new NodeLocation( FixedPrecisionCoordinateConvertor.convertToDouble(dataInStream.readInt()), FixedPrecisionCoordinateConvertor.convertToDouble(dataInStream.readInt())
/** * {@inheritDoc} */ @Override public NodeLocation getNodeLocation(long nodeId) { if (nodeLocationsReader == null) { nodeLocations.complete(); nodeLocationsReader = nodeLocations.createReader(); } try { return nodeLocationsReader.get(nodeId).getNodeLocation(); } catch (NoSuchIndexElementException e) { return new NodeLocation(); } }
store.addLocation(i * 2, new NodeLocation(longitude, latitude));