@Override public final int getAdditionalNodeField(int index) { if (that.extStorage.isRequireNodeField() && that.N_ADDITIONAL >= 0) return that.nodes.getInt((long) index * that.nodeEntryBytes + that.N_ADDITIONAL); else throw new AssertionError("This graph does not provide an additional node field"); }
@Override public final void setAdditionalNodeField(int index, int additionalValue) { if (that.extStorage.isRequireNodeField() && that.N_ADDITIONAL >= 0) { that.ensureNodeIndex(index); long tmp = (long) index * that.nodeEntryBytes; that.nodes.setInt(tmp + that.N_ADDITIONAL, additionalValue); } else { throw new AssertionError("This graph does not provide an additional node field"); } }
/** * Initializes the node area with the empty edge value and default additional value. */ void initNodeRefs(long oldCapacity, long newCapacity) { for (long pointer = oldCapacity + N_EDGE_REF; pointer < newCapacity; pointer += nodeEntryBytes) { nodes.setInt(pointer, EdgeIterator.NO_EDGE); } if (extStorage.isRequireNodeField()) { for (long pointer = oldCapacity + N_ADDITIONAL; pointer < newCapacity; pointer += nodeEntryBytes) { nodes.setInt(pointer, extStorage.getDefaultNodeFieldValue()); } } }
@Override public final void setNode(int nodeId, double lat, double lon, double ele) { that.ensureNodeIndex(nodeId); long tmp = (long) nodeId * that.nodeEntryBytes; that.nodes.setInt(tmp + that.N_LAT, Helper.degreeToInt(lat)); that.nodes.setInt(tmp + that.N_LON, Helper.degreeToInt(lon)); if (is3D()) { // meter precision is sufficient for now that.nodes.setInt(tmp + that.N_ELE, Helper.eleToInt(ele)); that.bounds.update(lat, lon, ele); } else { that.bounds.update(lat, lon); } // set the default value for the additional field of this node if (that.extStorage.isRequireNodeField()) that.nodes.setInt(tmp + that.N_ADDITIONAL, that.extStorage.getDefaultNodeFieldValue()); }
N_ELE = -1; if (extStorage.isRequireNodeField()) N_ADDITIONAL = nextNodeEntryIndex(4); else
@Override public final int getAdditionalNodeField(int index) { if (that.extStorage.isRequireNodeField() && that.N_ADDITIONAL >= 0) return that.nodes.getInt((long) index * that.nodeEntryBytes + that.N_ADDITIONAL); else throw new AssertionError("This graph does not provide an additional node field"); }
@Override public final int getAdditionalNodeField(int index) { if (that.extStorage.isRequireNodeField() && that.N_ADDITIONAL >= 0) return that.nodes.getInt((long) index * that.nodeEntryBytes + that.N_ADDITIONAL); else throw new AssertionError("This graph does not provide an additional node field"); }
@Override public final int getAdditionalNodeField( int index ) { if (that.extStorage.isRequireNodeField() && that.N_ADDITIONAL >= 0) return that.nodes.getInt((long) index * that.nodeEntryBytes + that.N_ADDITIONAL); else throw new AssertionError("This graph does not provide an additional node field"); }
@Override public final void setAdditionalNodeField(int index, int additionalValue) { if (that.extStorage.isRequireNodeField() && that.N_ADDITIONAL >= 0) { that.ensureNodeIndex(index); long tmp = (long) index * that.nodeEntryBytes; that.nodes.setInt(tmp + that.N_ADDITIONAL, additionalValue); } else { throw new AssertionError("This graph does not provide an additional node field"); } }
@Override public final void setAdditionalNodeField(int index, int additionalValue) { if (that.extStorage.isRequireNodeField() && that.N_ADDITIONAL >= 0) { that.ensureNodeIndex(index); long tmp = (long) index * that.nodeEntryBytes; that.nodes.setInt(tmp + that.N_ADDITIONAL, additionalValue); } else { throw new AssertionError("This graph does not provide an additional node field"); } }
@Override public final void setAdditionalNodeField( int index, int additionalValue ) { if (that.extStorage.isRequireNodeField() && that.N_ADDITIONAL >= 0) { that.ensureNodeIndex(index); long tmp = (long) index * that.nodeEntryBytes; that.nodes.setInt(tmp + that.N_ADDITIONAL, additionalValue); } else { throw new AssertionError("This graph does not provide an additional node field"); } }
/** * Initializes the node area with the empty edge value and default additional value. */ void initNodeRefs(long oldCapacity, long newCapacity) { for (long pointer = oldCapacity + N_EDGE_REF; pointer < newCapacity; pointer += nodeEntryBytes) { nodes.setInt(pointer, EdgeIterator.NO_EDGE); } if (extStorage.isRequireNodeField()) { for (long pointer = oldCapacity + N_ADDITIONAL; pointer < newCapacity; pointer += nodeEntryBytes) { nodes.setInt(pointer, extStorage.getDefaultNodeFieldValue()); } } }
/** * Initializes the node area with the empty edge value and default additional value. */ void initNodeRefs(long oldCapacity, long newCapacity) { for (long pointer = oldCapacity + N_EDGE_REF; pointer < newCapacity; pointer += nodeEntryBytes) { nodes.setInt(pointer, EdgeIterator.NO_EDGE); } if (extStorage.isRequireNodeField()) { for (long pointer = oldCapacity + N_ADDITIONAL; pointer < newCapacity; pointer += nodeEntryBytes) { nodes.setInt(pointer, extStorage.getDefaultNodeFieldValue()); } } }
/** * Initializes the node area with the empty edge value and default additional value. */ void initNodeRefs( long oldCapacity, long newCapacity ) { for (long pointer = oldCapacity + N_EDGE_REF; pointer < newCapacity; pointer += nodeEntryBytes) { nodes.setInt(pointer, EdgeIterator.NO_EDGE); } if (extStorage.isRequireNodeField()) { for (long pointer = oldCapacity + N_ADDITIONAL; pointer < newCapacity; pointer += nodeEntryBytes) { nodes.setInt(pointer, extStorage.getDefaultNodeFieldValue()); } } }
@Override public final void setNode(int nodeId, double lat, double lon, double ele) { that.ensureNodeIndex(nodeId); long tmp = (long) nodeId * that.nodeEntryBytes; that.nodes.setInt(tmp + that.N_LAT, Helper.degreeToInt(lat)); that.nodes.setInt(tmp + that.N_LON, Helper.degreeToInt(lon)); if (is3D()) { // meter precision is sufficient for now that.nodes.setInt(tmp + that.N_ELE, Helper.eleToInt(ele)); that.bounds.update(lat, lon, ele); } else { that.bounds.update(lat, lon); } // set the default value for the additional field of this node if (that.extStorage.isRequireNodeField()) that.nodes.setInt(tmp + that.N_ADDITIONAL, that.extStorage.getDefaultNodeFieldValue()); }
@Override public final void setNode(int nodeId, double lat, double lon, double ele) { that.ensureNodeIndex(nodeId); long tmp = (long) nodeId * that.nodeEntryBytes; that.nodes.setInt(tmp + that.N_LAT, Helper.degreeToInt(lat)); that.nodes.setInt(tmp + that.N_LON, Helper.degreeToInt(lon)); if (is3D()) { // meter precision is sufficient for now that.nodes.setInt(tmp + that.N_ELE, Helper.eleToInt(ele)); that.bounds.update(lat, lon, ele); } else { that.bounds.update(lat, lon); } // set the default value for the additional field of this node if (that.extStorage.isRequireNodeField()) that.nodes.setInt(tmp + that.N_ADDITIONAL, that.extStorage.getDefaultNodeFieldValue()); }
@Override public final void setNode( int nodeId, double lat, double lon, double ele ) { that.ensureNodeIndex(nodeId); long tmp = (long) nodeId * that.nodeEntryBytes; that.nodes.setInt(tmp + that.N_LAT, Helper.degreeToInt(lat)); that.nodes.setInt(tmp + that.N_LON, Helper.degreeToInt(lon)); if (is3D()) { // meter precision is sufficient for now that.nodes.setInt(tmp + that.N_ELE, Helper.eleToInt(ele)); that.bounds.update(lat, lon, ele); } else { that.bounds.update(lat, lon); } // set the default value for the additional field of this node if (that.extStorage.isRequireNodeField()) that.nodes.setInt(tmp + that.N_ADDITIONAL, that.extStorage.getDefaultNodeFieldValue()); }
N_ELE = -1; if (extStorage.isRequireNodeField()) N_ADDITIONAL = nextNodeEntryIndex(4); else
N_ELE = -1; if (extStorage.isRequireNodeField()) N_ADDITIONAL = nextNodeEntryIndex(4); else
N_ELE = -1; if (extStorage.isRequireNodeField()) N_ADDITIONAL = nextNodeEntryIndex(4); else