/** * Get the first value for the key specified by the index and the section. * * @param sectionName the name of the section * @param key the key for the section * @return the value at the specified index * @throws ArrayIndexOutOfBoundsException when the index is out of bounds */ public String getValue(String sectionName, String key) { IniSection section = doGetSection(sectionName); return section == null ? null : section.get(key, 0); }
public int getValueSize(String sectionName, String key) { IniSection section = doGetSection(sectionName); return section == null ? 0 : section.size(key); }
/** * Get the value for the key specified by the index and the section. * * @param sectionName the name of the section * @param key the key for the section * @param index the index in the list of values * @return the value at the specified index * @throws ArrayIndexOutOfBoundsException when the index is out of bounds */ public String getValue(String sectionName, String key, int index) { IniSection section = doGetSection(sectionName); return section == null ? null : section.get(key, index); }
/** * Output the Ini to the given Writer. * * @param out the Writer to which this Ini should be written */ private void save(Writer out) { PrintWriter writer = null; if (out instanceof PrintWriter) { writer = (PrintWriter) out; } else { writer = new PrintWriter(out); } for (String sectionName : list) { IniSection section = doGetSection(sectionName); section.save(writer); } }