/*
 * SDK Pullenti Lingvo, 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.ner.core;

public class NumberParseAttr implements Comparable<NumberParseAttr> {

    public static final NumberParseAttr NO; // 0

    public static final NumberParseAttr CANNOTBEINTEGER; // 1

    public static final NumberParseAttr NOWHITESPACES; // 2

    public static final NumberParseAttr COMMAISFLOATPOINT; // 4

    public static final NumberParseAttr SPEECHREGIME; // 8


    public int value() { return m_val; }
    private int m_val;
    private String m_str;
    private NumberParseAttr(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(NumberParseAttr 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, NumberParseAttr> mapIntToEnum; 
    private static java.util.HashMap<String, NumberParseAttr> mapStringToEnum; 
    private static NumberParseAttr[] m_Values; 
    private static java.util.Collection<Integer> m_Keys; 
    public static NumberParseAttr of(int val) {
        if (mapIntToEnum.containsKey(val)) return mapIntToEnum.get(val);
        NumberParseAttr item = new NumberParseAttr(val, ((Integer)val).toString());
        mapIntToEnum.put(val, item);
        mapStringToEnum.put(item.m_str.toUpperCase(), item);
        return item; 
    }
    public static NumberParseAttr 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 NumberParseAttr[] getValues() {
        return m_Values; 
    }
    static {
        mapIntToEnum = new java.util.HashMap<Integer, NumberParseAttr>();
        mapStringToEnum = new java.util.HashMap<String, NumberParseAttr>();
        NO = new NumberParseAttr(0, "NO");
        mapIntToEnum.put(NO.value(), NO);
        mapStringToEnum.put(NO.m_str.toUpperCase(), NO);
        CANNOTBEINTEGER = new NumberParseAttr(1, "CANNOTBEINTEGER");
        mapIntToEnum.put(CANNOTBEINTEGER.value(), CANNOTBEINTEGER);
        mapStringToEnum.put(CANNOTBEINTEGER.m_str.toUpperCase(), CANNOTBEINTEGER);
        NOWHITESPACES = new NumberParseAttr(2, "NOWHITESPACES");
        mapIntToEnum.put(NOWHITESPACES.value(), NOWHITESPACES);
        mapStringToEnum.put(NOWHITESPACES.m_str.toUpperCase(), NOWHITESPACES);
        COMMAISFLOATPOINT = new NumberParseAttr(4, "COMMAISFLOATPOINT");
        mapIntToEnum.put(COMMAISFLOATPOINT.value(), COMMAISFLOATPOINT);
        mapStringToEnum.put(COMMAISFLOATPOINT.m_str.toUpperCase(), COMMAISFLOATPOINT);
        SPEECHREGIME = new NumberParseAttr(8, "SPEECHREGIME");
        mapIntToEnum.put(SPEECHREGIME.value(), SPEECHREGIME);
        mapStringToEnum.put(SPEECHREGIME.m_str.toUpperCase(), SPEECHREGIME);
        java.util.Collection<NumberParseAttr> col = mapIntToEnum.values();
        m_Values = new NumberParseAttr[col.size()];
        col.toArray(m_Values);
        m_Keys = new java.util.ArrayList<Integer>(mapIntToEnum.keySet());
    }
}
