/*
 * SDK Pullenti Unitext, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software. 
 * This class is generated using the converter Unisharping (www.unisharping.ru) from Pullenti C# project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

package com.pullenti.unitext.internal.misc;

public class MyXmlNodeType implements Comparable<MyXmlNodeType> {

    public static final MyXmlNodeType NONE; // 0

    public static final MyXmlNodeType ELEMENT; // 1

    public static final MyXmlNodeType ATTRIBUTE; // 2

    public static final MyXmlNodeType TEXT; // 3

    public static final MyXmlNodeType CDATA; // 4

    public static final MyXmlNodeType ENTITYREFERENCE; // 5

    public static final MyXmlNodeType ENTITY; // 6

    public static final MyXmlNodeType PROCESSINGINSTRUCTION; // 7

    public static final MyXmlNodeType COMMENT; // 8

    public static final MyXmlNodeType DOCUMENT; // 9

    public static final MyXmlNodeType DOCUMENTTYPE; // 10

    public static final MyXmlNodeType DOCUMENTFRAGMENT; // 11

    public static final MyXmlNodeType NOTATION; // 12

    public static final MyXmlNodeType WHITESPACE; // 13

    public static final MyXmlNodeType SIGNIFICANTWHITESPACE; // 14

    public static final MyXmlNodeType ENDELEMENT; // 15

    public static final MyXmlNodeType ENDENTITY; // 16

    public static final MyXmlNodeType XMLDECLARATION; // 17


    public int value() { return m_val; }
    private int m_val;
    private String m_str;
    private MyXmlNodeType(int val, String str) { m_val = val; m_str = str; }
    @Override
    public String toString() {
        if(m_str != null) return m_str;
        return ((Integer)m_val).toString();
    }
    @Override
    public int hashCode() {
        return (int)m_val;
    }
    @Override
    public int compareTo(MyXmlNodeType v) {
        if(m_val < v.m_val) return -1;
        if(m_val > v.m_val) return 1;
        return 0;
    }
    private static java.util.HashMap<Integer, MyXmlNodeType> mapIntToEnum; 
    private static java.util.HashMap<String, MyXmlNodeType> mapStringToEnum; 
    private static MyXmlNodeType[] m_Values; 
    private static java.util.Collection<Integer> m_Keys; 
    public static MyXmlNodeType of(int val) {
        if (mapIntToEnum.containsKey(val)) return mapIntToEnum.get(val);
        MyXmlNodeType item = new MyXmlNodeType(val, ((Integer)val).toString());
        mapIntToEnum.put(val, item);
        mapStringToEnum.put(item.m_str.toUpperCase(), item);
        return item; 
    }
    public static MyXmlNodeType of(String str) {
        str = str.toUpperCase(); 
        if (mapStringToEnum.containsKey(str)) return mapStringToEnum.get(str);
        return null; 
    }
    public static boolean isDefined(Object val) {
        if(val instanceof Integer) return m_Keys.contains((Integer)val); 
        return false; 
    }
    public static MyXmlNodeType[] getValues() {
        return m_Values; 
    }
    static {
        mapIntToEnum = new java.util.HashMap<Integer, MyXmlNodeType>();
        mapStringToEnum = new java.util.HashMap<String, MyXmlNodeType>();
        NONE = new MyXmlNodeType(0, "NONE");
        mapIntToEnum.put(NONE.value(), NONE);
        mapStringToEnum.put(NONE.m_str.toUpperCase(), NONE);
        ELEMENT = new MyXmlNodeType(1, "ELEMENT");
        mapIntToEnum.put(ELEMENT.value(), ELEMENT);
        mapStringToEnum.put(ELEMENT.m_str.toUpperCase(), ELEMENT);
        ATTRIBUTE = new MyXmlNodeType(2, "ATTRIBUTE");
        mapIntToEnum.put(ATTRIBUTE.value(), ATTRIBUTE);
        mapStringToEnum.put(ATTRIBUTE.m_str.toUpperCase(), ATTRIBUTE);
        TEXT = new MyXmlNodeType(3, "TEXT");
        mapIntToEnum.put(TEXT.value(), TEXT);
        mapStringToEnum.put(TEXT.m_str.toUpperCase(), TEXT);
        CDATA = new MyXmlNodeType(4, "CDATA");
        mapIntToEnum.put(CDATA.value(), CDATA);
        mapStringToEnum.put(CDATA.m_str.toUpperCase(), CDATA);
        ENTITYREFERENCE = new MyXmlNodeType(5, "ENTITYREFERENCE");
        mapIntToEnum.put(ENTITYREFERENCE.value(), ENTITYREFERENCE);
        mapStringToEnum.put(ENTITYREFERENCE.m_str.toUpperCase(), ENTITYREFERENCE);
        ENTITY = new MyXmlNodeType(6, "ENTITY");
        mapIntToEnum.put(ENTITY.value(), ENTITY);
        mapStringToEnum.put(ENTITY.m_str.toUpperCase(), ENTITY);
        PROCESSINGINSTRUCTION = new MyXmlNodeType(7, "PROCESSINGINSTRUCTION");
        mapIntToEnum.put(PROCESSINGINSTRUCTION.value(), PROCESSINGINSTRUCTION);
        mapStringToEnum.put(PROCESSINGINSTRUCTION.m_str.toUpperCase(), PROCESSINGINSTRUCTION);
        COMMENT = new MyXmlNodeType(8, "COMMENT");
        mapIntToEnum.put(COMMENT.value(), COMMENT);
        mapStringToEnum.put(COMMENT.m_str.toUpperCase(), COMMENT);
        DOCUMENT = new MyXmlNodeType(9, "DOCUMENT");
        mapIntToEnum.put(DOCUMENT.value(), DOCUMENT);
        mapStringToEnum.put(DOCUMENT.m_str.toUpperCase(), DOCUMENT);
        DOCUMENTTYPE = new MyXmlNodeType(10, "DOCUMENTTYPE");
        mapIntToEnum.put(DOCUMENTTYPE.value(), DOCUMENTTYPE);
        mapStringToEnum.put(DOCUMENTTYPE.m_str.toUpperCase(), DOCUMENTTYPE);
        DOCUMENTFRAGMENT = new MyXmlNodeType(11, "DOCUMENTFRAGMENT");
        mapIntToEnum.put(DOCUMENTFRAGMENT.value(), DOCUMENTFRAGMENT);
        mapStringToEnum.put(DOCUMENTFRAGMENT.m_str.toUpperCase(), DOCUMENTFRAGMENT);
        NOTATION = new MyXmlNodeType(12, "NOTATION");
        mapIntToEnum.put(NOTATION.value(), NOTATION);
        mapStringToEnum.put(NOTATION.m_str.toUpperCase(), NOTATION);
        WHITESPACE = new MyXmlNodeType(13, "WHITESPACE");
        mapIntToEnum.put(WHITESPACE.value(), WHITESPACE);
        mapStringToEnum.put(WHITESPACE.m_str.toUpperCase(), WHITESPACE);
        SIGNIFICANTWHITESPACE = new MyXmlNodeType(14, "SIGNIFICANTWHITESPACE");
        mapIntToEnum.put(SIGNIFICANTWHITESPACE.value(), SIGNIFICANTWHITESPACE);
        mapStringToEnum.put(SIGNIFICANTWHITESPACE.m_str.toUpperCase(), SIGNIFICANTWHITESPACE);
        ENDELEMENT = new MyXmlNodeType(15, "ENDELEMENT");
        mapIntToEnum.put(ENDELEMENT.value(), ENDELEMENT);
        mapStringToEnum.put(ENDELEMENT.m_str.toUpperCase(), ENDELEMENT);
        ENDENTITY = new MyXmlNodeType(16, "ENDENTITY");
        mapIntToEnum.put(ENDENTITY.value(), ENDENTITY);
        mapStringToEnum.put(ENDENTITY.m_str.toUpperCase(), ENDENTITY);
        XMLDECLARATION = new MyXmlNodeType(17, "XMLDECLARATION");
        mapIntToEnum.put(XMLDECLARATION.value(), XMLDECLARATION);
        mapStringToEnum.put(XMLDECLARATION.m_str.toUpperCase(), XMLDECLARATION);
        java.util.Collection<MyXmlNodeType> col = mapIntToEnum.values();
        m_Values = new MyXmlNodeType[col.size()];
        col.toArray(m_Values);
        m_Keys = new java.util.ArrayList<Integer>(mapIntToEnum.keySet());
    }
}
