MCPcopy Create free account
hub / github.com/apache/nutch / add

Method add

src/java/org/apache/nutch/metadata/Metadata.java:123–133  ·  view source on GitHub ↗

Add a metadata name/value mapping. Add the specified value to the list of values associated to the specified metadata name. @param name the metadata name. @param value the metadata value.

(final String name, final String value)

Source from the content-addressed store, hash-verified

121 * the metadata value.
122 */
123 public void add(final String name, final String value) {
124 String[] values = metadata.get(name);
125 if (values == null) {
126 set(name, value);
127 } else {
128 String[] newValues = new String[values.length + 1];
129 System.arraycopy(values, 0, newValues, 0, values.length);
130 newValues[newValues.length - 1] = value;
131 metadata.put(name, newValues);
132 }
133 }
134
135 /**
136 * Copy All key-value pairs from properties.

Callers 14

testWriteNonNullMethod · 0.95
testAddMethod · 0.95
testSetMethod · 0.95
testGetMethod · 0.95
testIsMultiValuedMethod · 0.95
testNamesMethod · 0.95
testRemoveMethod · 0.95
testObjectMethod · 0.95
testWritableMethod · 0.95
getParseMethod · 0.95
readFieldsMethod · 0.95

Calls 3

setMethod · 0.95
getMethod · 0.65
putMethod · 0.45

Tested by 10

testWriteNonNullMethod · 0.76
testAddMethod · 0.76
testSetMethod · 0.76
testGetMethod · 0.76
testIsMultiValuedMethod · 0.76
testNamesMethod · 0.76
testRemoveMethod · 0.76
testObjectMethod · 0.76
testWritableMethod · 0.76