public long put( long key, long value ) { synchronized( mutex ) { return m.put( key, value ); } } public long remove( long key ) {
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or Long(0) if none was found. */ public Long put( Long key, Long value ) { long k; long v; if ( key == null ) { k = _map.getNoEntryKey(); } else { k = unwrapKey( key ); } if ( value == null ) { v = _map.getNoEntryValue(); } else { v = unwrapValue( value ); } long retval = _map.put( k, v ); if ( retval == _map.getNoEntryValue() ) { return null; } return wrapValue( retval ); }
private void sendChunkRequest(Object obj) { log.debug("Sending chunking requests for {} guilds", obj instanceof JSONArray ? ((JSONArray) obj).length() : 1); long timeout = System.currentTimeMillis() + CHUNK_TIMEOUT; synchronized (pendingChunks) { if (obj instanceof JSONArray) { JSONArray arr = (JSONArray) obj; for (Object o : arr) pendingChunks.put((long) o, timeout); } else { pendingChunks.put((long) obj, timeout); } } getJDA().getClient().chunkOrSyncRequest( new JSONObject() .put("op", WebSocketCode.MEMBER_CHUNK_REQUEST) .put("d", new JSONObject() .put("guild_id", obj) .put("query", "") .put("limit", 0))); }
public long put( long key, long value ) { synchronized( mutex ) { return m.put( key, value ); } } public long remove( long key ) {
@Override public long put( long key, long value ) { synchronized( mutex ) { return m.put( key, value ); } } @Override
public long put( long key, long value ) { synchronized( mutex ) { return m.put( key, value ); } } public long remove( long key ) {
public long put( long key, long value ) { synchronized( mutex ) { return m.put( key, value ); } } public long remove( long key ) {
public Optional<Chunk> getChunkIfLoaded(int x, int z) { long chunkKey = toLong(x, z); Chunk chunk = chunksLoaded.get(chunkKey); if (chunk != null) { lastAccessTimes.put(chunkKey, System.currentTimeMillis()); } return Optional.ofNullable(chunk); }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or Long(0) if none was found. */ @Override public Long put( Long key, Long value ) { long k = unwrapKey( key ); long v = unwrapValue( value ); if ( _map.containsKey( k ) ) { long retval = _map.put( k, v ); return wrapValue( retval); } _map.put( k, v ); return null; }
private void processNode( OSMNode node ) { if (isInBounds(node)) { addNode(node); // analyze node tags for barriers if (node.hasTags()) { long nodeFlags = encodingManager.handleNodeTags(node); if (nodeFlags != 0) getNodeFlagsMap().put(node.getId(), nodeFlags); } locations++; } else { skippedLocations++; } }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or Long(0) if none was found. */ public Long put( Long key, Long value ) { long k; long v; if ( key == null ) { k = _map.getNoEntryKey(); } else { k = unwrapKey( key ); } if ( value == null ) { v = _map.getNoEntryValue(); } else { v = unwrapValue( value ); } long retval = _map.put( k, v ); if ( retval == _map.getNoEntryValue() ) { return null; } return wrapValue( retval ); }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or Long(0) if none was found. */ public Long put( Long key, Long value ) { long k; long v; if ( key == null ) { k = _map.getNoEntryKey(); } else { k = unwrapKey( key ); } if ( value == null ) { v = _map.getNoEntryValue(); } else { v = unwrapValue( value ); } long retval = _map.put( k, v ); if ( retval == _map.getNoEntryValue() ) { return null; } return wrapValue( retval ); }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or Long(0) if none was found. */ public Long put( Long key, Long value ) { long k; long v; if ( key == null ) { k = _map.getNoEntryKey(); } else { k = unwrapKey( key ); } if ( value == null ) { v = _map.getNoEntryValue(); } else { v = unwrapValue( value ); } long retval = _map.put( k, v ); if ( retval == _map.getNoEntryValue() ) { return null; } return wrapValue( retval ); }
getNodeFlagsMap().put(nodeId, 0);