/** * Get the values of a key of the first section. * The collection has insertion order. * Note many keys only have one value. * A key that has no values returns null. * * @param key the key * @return the keyed values or null if the key doesn't exist */ public Collection<String> getValues(String key) { IniSection section = getSection(); return section == null ? null : section.getValues(key); }
/** * Copy constructor * * @param config the config to copy */ public IniSection(IniSection config) { this.name = config.getName(); section = new HashMap<String, List<String>>(); for (String key : config.getKeys()) { for (String value : config.getValues(key)) { add(key, value); } } } /**
private void mergeConfig(IniSection config) { for (String key : config.getKeys()) { ConfigEntryType type = ConfigEntryType.fromString(key); for (String value : config.getValues(key)) { if (type != null && type.mayRepeat()) { if (!configAll.containsValue(key, value)) { configAll.add(key, value); } } else { setProperty(key, value); } } } }