<commit_before>/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/

package org.openoffice.xmerge.converter.xml.sxc;

import java.util.Vector;
import java.util.Enumeration;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.Element;

import org.openoffice.xmerge.converter.xml.OfficeConstants;
import org.openoffice.xmerge.util.Debug;
import org.openoffice.xmerge.util.XmlUtil;

/**
 * This is a class representing the different attributes for a worksheet
 * contained in settings.xml.
 *
 * @author <NAME>
 */
public class BookSettings implements OfficeConstants {

    /**  A w3c <code>Document</code>. */
    private org.w3c.dom.Document settings = null;

    private boolean hasColumnRowHeaders = true;
    private String  activeSheet         = new String();
    private Vector  worksheetSettings   = new Vector();

    /**
     * Default Constructor for a <code>BookSettings</code>
     *
     * @param dimension if it's a row the height, a column the width
     * @param repeated
     */
    public BookSettings(Node root) {
        readNode(root);
    }

    /**
     * Default Constructor for a <code>BookSettings</code>
     *
     * @param worksheetSettings if it's a row the height, a column the width
     */
    public BookSettings(Vector worksheetSettings) {
        this.worksheetSettings = worksheetSettings;
    }

    /**
     *
     */
    public void setColumnRowHeaders(boolean hasColumnRowHeaders) {
        this.hasColumnRowHeaders = hasColumnRowHeaders;
    }

    /**
     *
     */
    public boolean hasColumnRowHeaders() {
        return hasColumnRowHeaders;
    }

    /**
     * Gets the <code>Vector</code> of <code>SheetSettings</code>
     *
     * @return <code>Vector</code> of <code>SheetSettings</code>
     */
    public Vector getSheetSettings() {
        return worksheetSettings;
    }

    /**
     * Gets the active sheet name
     *
     * @return the active sheet name
     */
    public String getActiveSheet() {

        return activeSheet;
    }

    /**
     * Sets the active sheet name
     *
     * @param activeSheet the active sheet name
     */
    public void setActiveSheet(String activeSheet) {

        this.activeSheet = activeSheet;
    }


    /**
     * Adds an XML entry for a particular setting
     *
     * @param root the root node at which to add the xml entry
     * @param attriute the name of the attribute to add
     * @param type the attribute type (int, short etc)
     * @param value the value of the attribute
     */
    private void addConfigItem(Node root, String attribute, String type, String value) {

        Element configItem = settings.createElement(TAG_CONFIG_ITEM);
        configItem.setAttribute(ATTRIBUTE_CONFIG_NAME, attribute);<commit_msg>Fix javadoc comments in BookSettings.java<commit_after>/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/

package org.openoffice.xmerge.converter.xml.sxc;

import java.util.Vector;
import java.util.Enumeration;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.Element;

import org.openoffice.xmerge.converter.xml.OfficeConstants;
import org.openoffice.xmerge.util.Debug;
import org.openoffice.xmerge.util.XmlUtil;

/**
 * This is a class representing the different attributes for a worksheet
 * contained in settings.xml.
 *
 * @author <NAME>
 */
public class BookSettings implements OfficeConstants {

    /**  A w3c <code>Document</code>. */
    private org.w3c.dom.Document settings = null;

    private boolean hasColumnRowHeaders = true;
    private String  activeSheet         = new String();
    private Vector  worksheetSettings   = new Vector();

    /**
     * Constructor for a <code>BookSettings</code>. Reads document settings
     * from xml and inits SheetSettings variables.
     *
     * @param root The root XML node to read from.
     */
    public BookSettings(Node root) {
        readNode(root);
    }

    /**
     * Constructor for a <code>BookSettings</code>
     *
     * @param worksheetSettings If it's a row the height, a column the width
     */
    public BookSettings(Vector worksheetSettings) {
        this.worksheetSettings = worksheetSettings;
    }

    /**
     * Set the flag indicating whether we have row/column headers.
     *
     * @param hasColumnRowHeaders Flag to enable or disable headers.
     */
    public void setColumnRowHeaders(boolean hasColumnRowHeaders) {
        this.hasColumnRowHeaders = hasColumnRowHeaders;
    }

    /**
     * Get the flag indicating whether we have row/column headers.
     *
     * @return Flag indicating whether we have row/column headers.
     */
    public boolean hasColumnRowHeaders() {
        return hasColumnRowHeaders;
    }

    /**
     * Gets the <code>Vector</code> of <code>SheetSettings</code>
     *
     * @return <code>Vector</code> of <code>SheetSettings</code>
     */
    public Vector getSheetSettings() {
        return worksheetSettings;
    }

    /**
     * Gets the active sheet name
     *
     * @return the active sheet name
     */
    public String getActiveSheet() {

        return activeSheet;
    }

    /**
     * Sets the active sheet name
     *
     * @param activeSheet the active sheet name
     */
    public void setActiveSheet(String activeSheet) {

        this.activeSheet = activeSheet;
    }

    /**
     * Adds an XML entry for a particular setting
     *
     * @param root the root node at which to add the xml entry
     * @param attriute the name of the attribute to add
     * @param type the attribute type (int, short etc)
     * @param value the value of the attribute
     */
    private void addConfigItem(Node root, String attribute, String type, String value) {

        Element configItem = settings.createElement(TAG_CONFIG_ITEM);
        configItem.setAttribute(ATTRIBUTE_CONFIG_NAME, attribute);
{'fraction_non_alphanumeric': 0.1163654369893538, 'fraction_numerical': 0.004456548650656103, 'mean_word_length': 3.021403683424589, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 9}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '683389', 'n_tokens_mistral': 2215, 'n_tokens_neox': 2125, 'n_words': 771}