Ejemplo n.º 1
0
 /**
  * Adds a section if it doesn't exist yet.
  *
  * @param name the name of the section
  * @return <code>true</code> if the section didn't already exist
  * @throws IllegalArgumentException the name is illegal, ie contains one of the characters '[' and
  *     ']' or consists only of white space
  */
 public boolean addSection(String name) {
   String normName = normSection(name);
   if (!hasSection(normName)) {
     // Section constructor might throw IllegalArgumentException
     Section section = new Section(normName, this.commentDelims, this.isCaseSensitive);
     section.setOptionFormat(this.optionFormat);
     this.sections.put(normName, section);
     this.sectionOrder.add(normName);
     return true;
   } else {
     return false;
   }
 }