public short get( int index ) { synchronized( mutex ) { return list.get( index ); } } public short set( int index, short element) {
@Override public Short get( int index ) { short value = list.get( index ); if ( value == list.getNoEntryValue() ) return null; else return Short.valueOf( value ); }
public short get( int index ) { return list.get( index ); } public int indexOf( short o ) { return list.indexOf( o ); }
@Override public Short get( int index ) { short value = list.get( index ); if ( value == list.getNoEntryValue() ) return null; else return Short.valueOf( value ); }
/** * @return the car speed on this edge, taking live traffic updates into account if requested (though that's not * yet implemented) */ public float getCarSpeedMetersPerSecond() { return (float) ((speeds.get(edgeIndex) / 100.)); }
@Override public Short get( int index ) { short value = list.get( index ); if ( value == list.getNoEntryValue() ) return null; else return Short.valueOf( value ); }
@Override public short get( int index ) { synchronized( mutex ) { return list.get( index ); } } @Override
@Override public Short get( int index ) { short value = list.get( index ); if ( value == list.getNoEntryValue() ) return null; else return Short.valueOf( value ); }
/** * @return the car speed on this edge, taking live traffic updates into account if requested (though that's not * yet implemented) */ public float getCarSpeedMetersPerSecond() { return (float) ((speeds.get(edgeIndex) / 100.)); }
@Override public Short get( int index ) { short value = list.get( index ); if ( value == list.getNoEntryValue() ) return null; else return Short.valueOf( value ); }
public short get( int index ) { synchronized( mutex ) { return list.get( index ); } } public short set( int index, short element) {
@Override public int get(int index) { if (index < offset) return 0; return data.get(index - offset); }
public short get( int index ) { return list.get( index ); } public int indexOf( short o ) { return list.indexOf( o ); }
public short get( int index ) { synchronized( mutex ) { return list.get( index ); } } public short set( int index, short element) {
public short get( int index ) { synchronized( mutex ) { return list.get( index ); } } public short set( int index, short element) {
public float getSpeedkmh() { return (float) ((speeds.get(edgeIndex) / 100.) * 3.6); }
public static OffHeapColumn tinyColumnToOffHeap(TinyColumn in) { OffHeapColumn m = new OffHeapColumn(in.offset); for (int i = 0; i < in.getNumRecords(); i++) { m.append(in.data.get(i)); } return m; } }
@Override public void write(Kryo kryo, Output output) { output.writeInt(this.data.size()); output.writeInt(this.offset); for (int i = 0; i < this.data.size(); i++) output.writeShort(this.data.get(i)); }
/** * Copy the flags and speeds from the supplied Edge cursor into this one. * Doesn't copy OSM ids since those are set when edge is created. * This is a hack and should be done some other way. */ public void copyPairFlagsAndSpeeds(Edge other) { int foreEdge = pairIndex * 2; int backEdge = foreEdge + 1; int otherForeEdge = other.pairIndex * 2; int otherBackEdge = otherForeEdge + 1; flags.set(foreEdge, other.getEdgeStore().flags.get(otherForeEdge)); flags.set(backEdge, other.getEdgeStore().flags.get(otherBackEdge)); speeds.set(foreEdge, other.getEdgeStore().speeds.get(otherForeEdge)); speeds.set(backEdge, other.getEdgeStore().speeds.get(otherBackEdge)); }
/** * Copy the flags and speeds from the supplied Edge cursor into this one. * Doesn't copy OSM ids since those are set when edge is created. * This is a hack and should be done some other way. */ public void copyPairFlagsAndSpeeds(Edge other) { int foreEdge = pairIndex * 2; int backEdge = foreEdge + 1; int otherForeEdge = other.pairIndex * 2; int otherBackEdge = otherForeEdge + 1; flags.set(foreEdge, other.getEdgeStore().flags.get(otherForeEdge)); flags.set(backEdge, other.getEdgeStore().flags.get(otherBackEdge)); speeds.set(foreEdge, other.getEdgeStore().speeds.get(otherForeEdge)); speeds.set(backEdge, other.getEdgeStore().speeds.get(otherBackEdge)); }