d_normalisationtable.java

来自「normkit is a set of tools supporting ont」· Java 代码 · 共 77 行

JAVA
77
字号
package it.itc.ectrl.normkit.common;

import java.util.*;
import it.itc.ectrl.normkit.common.NormalisationException;
import org.w3c.dom.Node;


 /**
 * NormalisationTable provides mechanisms to access and manipulate the Normalisation Entries existing in the normalisation process.
 * @author Oliver Fodor (fodor@itc.it)
 **/

public class D_NormalisationTable {

    Set m_setTranslationInformations = new HashSet();

    public D_NormalisationEntry add( int intDTMXMLNode, String strURIInstance, String strURINodeBridge ) throws Exception {

        D_NormalisationEntry ti = new D_NormalisationEntry( intDTMXMLNode, strURIInstance, strURINodeBridge );

        m_setTranslationInformations.add( ti );

        return ti;
    }


    public void clear() {

        m_setTranslationInformations.clear();

    }

    public Iterator iterator() {

        return m_setTranslationInformations.iterator();

    }


    public D_NormalisationEntry getD_NormalisationEntry( int intDTMXMLNode ) throws NormalisationException {

        D_NormalisationEntry tiBest = null;

        Iterator it = m_setTranslationInformations.iterator();
        for(; it.hasNext(); )
        {
            D_NormalisationEntry ti = (D_NormalisationEntry) it.next();

            if( intDTMXMLNode == ti.getDTMTranslatedXMLNode()) {
                tiBest = ti;
                return tiBest;
            }
        }

        throw new NormalisationException("Normalisation entry for DTM node " + intDTMXMLNode + " doesn't exist.");

    }

    public D_NormalisationEntry getD_NormalisationEntry( String strURIInstance ) throws NormalisationException {

        D_NormalisationEntry tiBest = null;

        Iterator it = m_setTranslationInformations.iterator();
        for(; it.hasNext(); )
        {
            D_NormalisationEntry ti = (D_NormalisationEntry) it.next();

            if( strURIInstance.equals(ti.getURITranslatedInstance())) {
                tiBest = ti;
                return tiBest;
            }
        }

        throw new NormalisationException("Normalisation entry for entity " + strURIInstance + " doesn't exist.");
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?