<commit_before>/*
 * Copyright 2001-2004 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.ws.scout.registry.infomodel;

import javax.xml.registry.JAXRException;
import javax.xml.registry.LifeCycleManager;
import javax.xml.registry.infomodel.ClassificationScheme;
import javax.xml.registry.infomodel.Concept;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

/**
 * Implements JAXR Interface.
 * For futher details, look into the JAXR API Javadoc.
 *
 * @author <NAME>  <<EMAIL>>
 */
public class ClassificationSchemeImpl
        extends RegistryEntryImpl
        implements ClassificationScheme
{

    private Collection childConcepts = new ArrayList();

    private int valueType = 1;

    private boolean external = false;
    
    /**
     * Creates a new instance of ClassificationSchemeImpl
     */
    public ClassificationSchemeImpl(LifeCycleManager lifeCycleManager)
    {
        super(lifeCycleManager);
    }

    public void addChildConcept(Concept concept)
            throws JAXRException
    {
        childConcepts.add(concept);
    }

    public void addChildConcepts(Collection collection)
            throws JAXRException
    {
        childConcepts.addAll(collection);
    }

    public int getChildConceptCount()
            throws JAXRException
    {
        return childConcepts.size();
    }

    public Collection getChildrenConcepts() throws JAXRException
    {
        return childConcepts;
    }

    public Collection getDescendantConcepts() throws JAXRException
    {
         Collection coll = new ArrayList();
        Iterator iter = childConcepts.iterator();
        while(iter != null && iter.hasNext())
        {
            ConceptImpl c = (ConceptImpl)iter.next();
            coll.add(c);
            coll.addAll(c.getDescendantConcepts());
        }
        return coll;
    }

    public int getValueType() throws JAXRException
    {
        return this.valueType;
    }

    public boolean isExternal() throws JAXRException
    {
        return this.external;
    }

    public void removeChildConcept(Concept concept)
            throws JAXRException
    {
        this.childConcepts.remove(concept);
    }

    public void removeChildConcepts(Collection collection)
            throws JAXRException
    {
        this.childConcepts.removeAll(collection);
    }

    public void setValueType(int param) throws JAXRException
    {
        this.valueType = param;
    }

}<commit_msg>fixed - value type is a capability level 1 feature -This line, and those below, will be ignored--<commit_after>/*
 * Copyright 2001-2004 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.ws.scout.registry.infomodel;

import javax.xml.registry.JAXRException;
import javax.xml.registry.LifeCycleManager;
import javax.xml.registry.UnsupportedCapabilityException;
import javax.xml.registry.infomodel.ClassificationScheme;
import javax.xml.registry.infomodel.Concept;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

/**
 * Implements JAXR Interface.
 * For futher details, look into the JAXR API Javadoc.
 *
 * @author <NAME>  <<EMAIL>>
 */
public class ClassificationSchemeImpl
        extends RegistryEntryImpl
        implements ClassificationScheme
{

    private Collection childConcepts = new ArrayList();

    private int valueType = 1;

    private boolean external = false;
    
    /**
     * Creates a new instance of ClassificationSchemeImpl
     */
    public ClassificationSchemeImpl(LifeCycleManager lifeCycleManager)
    {
        super(lifeCycleManager);
    }

    public void addChildConcept(Concept concept)
            throws JAXRException
    {
        childConcepts.add(concept);
    }

    public void addChildConcepts(Collection collection)
            throws JAXRException
    {
        childConcepts.addAll(collection);
    }

    public int getChildConceptCount()
            throws JAXRException
    {
        return childConcepts.size();
    }

    public Collection getChildrenConcepts() throws JAXRException
    {
        return childConcepts;
    }

    public Collection getDescendantConcepts() throws JAXRException
    {
         Collection coll = new ArrayList();
        Iterator iter = childConcepts.iterator();
        while(iter != null && iter.hasNext())
        {
            ConceptImpl c = (ConceptImpl)iter.next();
            coll.add(c);
            coll.addAll(c.getDescendantConcepts());
        }
        return coll;
    }

    public int getValueType()
        throws JAXRException
    {
        /*
         * we are a level 0 provider
         */

        throw new UnsupportedCapabilityException();
    }

    public boolean isExternal() throws JAXRException
    {
        return this.external;
    }

    public void removeChildConcept(Concept concept)
            throws JAXRException
    {
        this.childConcepts.remove(concept);
    }

    public void removeChildConcepts(Collection collection)
            throws JAXRException
    {
        this.childConcepts.removeAll(collection);
    }

    public void setValueType(int param)
        throws JAXRException
    {
        /*
         * we are a level 0 provider
         */

        throw new UnsupportedCapabilityException();
    }

}
{'fraction_non_alphanumeric': 0.07549835190707894, 'fraction_numerical': 0.004551875686705384, 'mean_word_length': 2.7176196032672113, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4828412', 'n_tokens_mistral': 1780, 'n_tokens_neox': 1686, 'n_words': 496}