/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey( Object key ) { return _map.containsKey( key ); }
public boolean containsKey( Object key ) { synchronized( mutex ) { return m.containsKey( key ); } } public boolean containsValue( int value ){
public boolean containsKey( Object key ){ return m.containsKey( key ); } public boolean containsValue( int val ) { return m.containsValue( val ); }
private int getTileIndex(ResourceUrn uri, boolean warnOnError) { if (tileIndexes.containsKey(uri)) { return tileIndexes.get(uri); } if (warnOnError) { logger.warn("Tile {} could not be resolved", uri); } return 0; }
/** * Build the ID - Index map if needed. */ private synchronized void buildIdIndexMapIfNeeded () { // we check again if the map has been built. It's possible that it would have been built // by this method in another thread while this instantiation was blocked. if (idIndexMap == null) { // make a local object, don't expose to public view until it's built TObjectIntMap idIndexMap = new TObjectIntHashMap<String>(this.capacity, 1f, -1); for (int i = 0; i < this.capacity; i++) { if (ids[i] != null) { if (idIndexMap.containsKey(ids[i])) { LOG.error("Duplicate ID {} in pointset.", ids[i]); } else { idIndexMap.put(ids[i], i); } } } // now expose to public view; reference assignment is an atomic operation this.idIndexMap = idIndexMap; } }
private int getUniformLocation(int activeShaderProgramId, String desc) { UniformId id = new UniformId(activeShaderProgramId, desc); if (uniformLocationMap.containsKey(id)) { return uniformLocationMap.get(id); } int loc = GL20.glGetUniformLocation(activeShaderProgramId, desc); uniformLocationMap.put(id, loc); return loc; }
@Override public void visitVertex(State state) { Vertex vertex = state.getVertex(); if (vertex instanceof TransitStop) { Stop stop = ((TransitStop)vertex).getStop(); if (stopsFound.containsKey(stop)) return; // record only the closest stop in each cluster stopsFound.put(stop, (int) state.getElapsedTimeSeconds()); } } }
@Override public void setTexture(String desc, Texture texture) { if (isDisposed()) { return; } int texId; if (bindMap.containsKey(desc)) { texId = bindMap.get(desc); } else { // TODO: do this initially, and try and have similar textures in similar slots for all materials. ShaderParameterMetadata metadata = shader.getParameter(desc); if (metadata == null || !metadata.getType().isTexture()) { return; } texId = textureIndex++; // Make sure to bind the texture for all permutations setInt(desc, texId); bindMap.put(desc, texId); } textureMap.put(texId, texture); }
if ( value == no_entry_value ) { if ( !( that.get( key ) == that.getNoEntryValue() && that.containsKey( key ) ) ) {
if ( value == no_entry_value ) { if ( !( that.get( key ) == that.getNoEntryValue() && that.containsKey( key ) ) ) {
final int getId(Class<? extends DefinedPacket> packet, int version) { ProtocolData protocolData = getProtocolData( version ); if ( protocolData == null ) { throw new BadPacketException( "Unsupported protocol version" ); } Preconditions.checkArgument( protocolData.packetMap.containsKey( packet ), "Cannot get ID for packet %s in phase %s with direction %s", packet, protocolPhase, direction ); return protocolData.packetMap.get( packet ); } }
/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey( Object key ) { return _map.containsKey( key ); }
/** * Returns true if an attribute has the provided name. * * @param name The name to lookup * @return Whether or not an attribute possesses the name */ public boolean hasAttribute(String name) { return nameToIndex.containsKey(name); }
@Override public boolean containsKey( Object key ) { synchronized( mutex ) { return m.containsKey( key ); } } @Override
/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ @Override public boolean containsKey( Object key ) { return _map.containsKey( key ); }
public int getRegistrationID(Class<? extends RemoteYoGraphic> clazz) { if (!registrationIDs.containsKey(clazz)) throw new RuntimeException("The class: " + clazz.getSimpleName() + " is not registered."); return registrationIDs.get(clazz); }
private int consumption(VM v, int a) { if (wantedAmount.containsKey(v)) { return Math.max(a, wantedAmount.get(v)); } return a; }
@Override public boolean add(E item) { if (idx.containsKey(item)) { return false; } idx.put(item, dta.size()); dta.add(item); return true; }
private int capacity(Node n, int a) { if (wantedCapacity.containsKey(n)) { return Math.max(a, wantedCapacity.get(n)); } return a; }
public <T extends RemoteYoGraphic> void registerBuilder(Class<T> clazz, YoGraphicFromMessageBuilder<T> builder) { int id = clazz.getName().hashCode(); if (registrationIDs.containsKey(clazz)) throw new RuntimeException("The class: " + clazz.getSimpleName() + " has already been registered."); classList.add(clazz); registrationIDs.put(clazz, id); registrationClasses.put(id, clazz); registrationBuilders.put(id, builder); }