Adds the mapping and its canonical closure.
Takes ce32=dataBuilder.encodeCEs(...) so that the data builder
need not re-encode the CEs multiple times.
972174
private int addWithClosure(CharSequence nfdPrefix, CharSequence nfdString,
                long[] newCEs, int newCEsLength, int ce32) {
        // Map from the NFD input to the CEs.
        ce32 = addIfDifferent(nfdPrefix, nfdString, newCEs, newCEsLength, ce32);
        ce32 = addOnlyClosure(nfdPrefix, nfdString, newCEs, newCEsLength, ce32);
        addTailComposites(nfdPrefix, nfdString);
        return ce32;
    }
1323209
private void finalizeCEs() {
        CollationDataBuilder newBuilder = new CollationDataBuilder();
        newBuilder.initForTailoring(baseData);
        CEFinalizer finalizer = new CEFinalizer(nodes.getBuffer());
        newBuilder.copyFrom(dataBuilder, finalizer);
        dataBuilder = newBuilder;
    }
1337536
@NonNull
  public static <K, V> ImmutableMap<K, V> append(
      @NonNull ImmutableMap<K, V> map, @NonNull K newKey, @NonNull V newValue) {
    ImmutableMap.Builder<K, V> builder = ImmutableMap.builder();
    for (Map.Entry<K, V> entry : map.entrySet()) {
      if (!entry.getKey().equals(newKey)) {
        builder.put(entry);
      }
    }
    builder.put(newKey, newValue);
    return builder.build();
  }
156966
public void addMapping( byte[] src, String dest ) throws IOException
    {
        if( src.length == 1 )
        {
        	singleByteMappings.put( Integer.valueOf( src[0] & 0xff ), dest );
        }
        else if( src.length == 2 )
        {
            int intSrc = src[0]&0xFF;
            intSrc <<= 8;
            intSrc |= (src[1]&0xFF);
            doubleByteMappings.put( Integer.valueOf( intSrc ), dest );
        }
        else
        {
            throw new IOException( "Mapping code should be 1 or two bytes and not " + src.length );
        }
    }
959254
def add_mappings(self, defn: Definition, target: Dict) -> None:
        
        self.add_id_prefixes(defn)
        for mapping in defn.mappings:
            if '://' in mapping:
                target['@id'] = mapping
            else:
                if ':' not in mapping or len(mapping.split(':')) != 2:
                    raise ValueError(f"Definition {defn.name} = unrecognized mapping: {mapping}")
                ns = mapping.split(':')[0]
                self.add_prefix(ns)
                target['@id'] = defn.mappings[0]
187598
public void setMappings(List<String> mappings) {
        if (mappings.size() > 0) {
            @SuppressWarnings("unchecked") Pair<String, String>[] renames = (Pair<String, String>[])Array.newInstance(Pair.class, mappings.size());
            for (int i = 0; i < _renames.length; ++i) {
                String[] names = mappings.get(i).split("[ ,]+");
                renames[i] = new Pair<String, String>(names[0], names[1]);
            }
            _renames = renames;
        }
    }
478549
@Override
    public void addConverter(Class<?> from, Class<?> to, Converter converter) {
        Map toMap = fromMap.get(from);
        if (toMap == null) {
            toMap = new HashMap<Class<?>, Map<Class<?>, Converter>>();
            fromMap.put(from, toMap);
        }
        toMap.put(to, converter);
    }
1351930
public static <IN> CassandraSinkBuilder<IN> addSink(org.apache.flink.streaming.api.scala.DataStream<IN> input) {
		return addSink(input.javaStream());
	}
857344
public static void addDeclaredMethodsFromInterfaces(ClassNode cNode, Map<String, MethodNode> methodsMap) {
        // add in unimplemented abstract methods from the interfaces
        for (ClassNode iface : cNode.getInterfaces()) {
            Map<String, MethodNode> ifaceMethodsMap = iface.getDeclaredMethodsMap();
            for (Map.Entry<String, MethodNode> entry : ifaceMethodsMap.entrySet()) {
                String methSig = entry.getKey();
                if (!methodsMap.containsKey(methSig)) {
                    methodsMap.put(methSig, entry.getValue());
                }
            }
        }
    }
592613
public void append(Encoder encoder, EncodingState encodingState, CharSequence str, int off, int len)
            throws IOException {
        if (str == null || len <= 0) {
            return;
        }
        if (shouldEncode(encoder, encodingState)) {
            EncodingState newEncoders = createNewEncodingState(encoder, encodingState);
            if (encoder instanceof StreamingEncoder) {
                ((StreamingEncoder)encoder).encodeToStream(encoder, str, off, len, this, newEncoders);
            }
            else {
                CharSequence source;
                if (CharSequences.canUseOriginalForSubSequence(str, off, len)) {
                    source = str;
                }
                else {
                    source = str.subSequence(off, off + len);
                }
                encodeAndWrite(encoder, newEncoders, source);
            }
        }
        else {
            appendCharSequence(encodingState, str, off, off + len);
        }
    }
1317762
public void append(Encoder encoder, EncodingState encodingState, char[] b, int off, int len) throws IOException {
        if (b == null || len <= 0) {
            return;
        }
        if (shouldEncode(encoder, encodingState)) {
            EncodingState newEncoders = createNewEncodingState(encoder, encodingState);
            if (encoder instanceof StreamingEncoder) {
                ((StreamingEncoder)encoder).encodeToStream(encoder, CharSequences.createCharSequence(b, off, len), 0, len, this,
                        newEncoders);
            }
            else {
                encodeAndWrite(encoder, newEncoders, String.valueOf(b, off, len));
            }
        }
        else {
            write(encodingState, b, off, len);
        }
    }
479199
public boolean addConverter(byte[] source, byte[] destination, int n) {
        if (started) return false;
        TranscoderDB.Entry entry = TranscoderDB.getEntry(source, destination);
        if (entry == null) return false;
        Transcoder transcoder = entry.getTranscoder();
        if (transcoder == null) return false;
        addTranscoderAt(transcoder, n);
        return true;
    }
143563
def _encode_mapping(mapping, f):
	""""""
	f.write(_TYPE_DICT)
	for key, value in sorted(mapping.items()):
		_encode_buffer(key, f)
		bencode(value, f)
	f.write(_TYPE_END)
141793
private static synchronized void addToCache(Cache cache, byte[] encoding,
            Object value) {
        if (encoding.length > ENC_MAX_LENGTH) {
            return;
        }
        Object key = new Cache.EqualByteArray(encoding);
        cache.put(key, value);
    }
390943
public void addMapping(Mapping mapping)
    {
        if (mapping != null)
        {
            mappings.put(mapping.getType(), mapping);
        }
    }
1301969
void add(Mapping aMapping) {
        if (generatedPositionAfter(this._last, aMapping)) {
            this._last = aMapping;
            this._array.add(aMapping);
        } else {
            this._sorted = false;
            this._array.add(aMapping);
        }
    }
230025
public CacheConfigurationBuilder<K, V> add(ServiceConfiguration<?> configuration) {
    CacheConfigurationBuilder<K, V> otherBuilder = new CacheConfigurationBuilder<>(this);

    if (getExistingServiceConfiguration(configuration.getClass()) != null) {
      if (configuration instanceof DefaultCopierConfiguration) {
        DefaultCopierConfiguration<?> copierConfiguration = (DefaultCopierConfiguration<?>) configuration;
        otherBuilder.removeExistingCopierConfigFor(copierConfiguration.getType());
      } else if (configuration instanceof DefaultSerializerConfiguration) {
        DefaultSerializerConfiguration<?> serializerConfiguration = (DefaultSerializerConfiguration<?>) configuration;
        otherBuilder.removeExistingSerializerConfigFor(serializerConfiguration.getType());
      } else if (!(configuration instanceof DefaultCacheEventListenerConfiguration)) {
        throw new IllegalStateException("Cannot add a generic service configuration when another one already exists. " +
                                        "Rely on specific with* methods or make sure your remove other configuration first.");
      }
    }
    otherBuilder.serviceConfigurations.add(configuration);
    return otherBuilder;
  }