long getEntityId(int netId) { return netIdToEntityId.get(netId); }
/** * Retrieves the value for <tt>key</tt> * * @param key an <code>Object</code> value * @return the value of <tt>key</tt> or null if no such mapping exists. */ public Long get( Object key ) { int k; if ( key != null ) { if ( key instanceof Integer ) { k = unwrapKey( key ); } else { return null; } } else { k = _map.getNoEntryKey(); } long v = _map.get( k ); // There may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if ( v == _map.getNoEntryValue() ) { return null; } else { return wrapValue( v ); } }
/** {@inheritDoc} */ @Override public boolean equals( Object other ) { if ( ! ( other instanceof TIntLongMap ) ) { return false; } TIntLongMap that = ( TIntLongMap ) other; if ( that.size() != this.size() ) { return false; } long[] values = _values; byte[] states = _states; long this_no_entry_value = getNoEntryValue(); long that_no_entry_value = that.getNoEntryValue(); for ( int i = values.length; i-- > 0; ) { if ( states[i] == FULL ) { int key = _set[i]; long that_value = that.get( key ); long this_value = values[i]; if ( ( this_value != that_value ) && ( this_value != this_no_entry_value ) && ( that_value != that_no_entry_value ) ) { return false; } } } return true; }
public long get( int key ) { synchronized( mutex ) { return m.get( key ); } }
final long userId = ssrcMap.get(ssrc); Decoder decoder = opusDecoders.get(ssrc); if (userId == ssrcMap.getNoEntryValue())
public long get( int key) { return m.get( key ); }
public EntityRef getEntity(int netId) { if (mode == NetworkMode.CLIENT) { if (entityManager != null) { return new NetEntityRef(netId, this, entityManager); } else { logger.error("Requesting entity before entity manager set up"); } } else { long entityId = netIdToEntityId.get(netId); if (entityManager != null && entityId != NULL_NET_ID) { return entityManager.getEntity(entityId); } } return EntityRef.NULL; }
protected void updateUserSSRC(int ssrc, long userId) { if (ssrcMap.containsKey(ssrc)) { long previousId = ssrcMap.get(ssrc); if (previousId != userId) { //Different User already existed with this ssrc. What should we do? Just replace? Probably should nuke the old opusDecoder. //Log for now and see if any user report the error. LOG.error("Yeah.. So.. JDA received a UserSSRC update for an ssrc that already had a User set. Inform DV8FromTheWorld.\nChannelId: {} SSRC: {} oldId: {} newId: {}", channel.get().getId(), ssrc, previousId, userId); } } else { ssrcMap.put(ssrc, userId); //Only create a decoder if we are actively handling received audio. if (receiveThread != null && AudioNatives.ensureOpus()) opusDecoders.put(ssrc, new Decoder(ssrc)); } }
@Override public final long getLong(int index) { this.checkBounds(index, length); return codes.get(index); }
/** * @return OSM way ID from specified edgeId. Only previously stored OSM-way-IDs are returned in * order to reduce memory overhead. */ public long getOsmIdOfInternalEdge( int edgeId ) { return getEdgeIdToOsmWayIdMap().get(edgeId); }
@Override public final long getLong(int index) { this.checkBounds(index, length); return values.get(index); }
@Override public final Long getValue(int index) { this.checkBounds(index, length); return values.get(index); }
@Override public final long getLong(int index) { this.checkBounds(index, length); return values.get(index); }
@Override public final ZonedDateTime getValue(int index) { this.checkBounds(index, length); final long value = values.get(index); if (value == nullValue) { return null; } else { final ZoneId zone = zoneIdMap2.get(zoneIds.get(index)); final Instant instant = Instant.ofEpochMilli(value); return ZonedDateTime.ofInstant(instant, zone); } }
@Override public final boolean isEqualTo(int index, T value) { if (value == null) { return isNull(index); } else { final long code = coding.getCode(value); return code == codes.get(index); } }
@Override public final T getValue(int index) { this.checkBounds(index, length); final long code = codes.get(index); return coding.getValue(code); }
@Override public final Array<Long> cumSum() { final int length = length(); final Array<Long> result = Array.of(Long.class, length); result.setLong(0, values.get(0)); for (int i=1; i<length; ++i) { final long prior = result.getLong(i-1); final long current = values.get(i); result.setLong(i, prior + current); } return result; }