/*
 * 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 ComplexNumCompareType implements Comparable<ComplexNumCompareType> {

    /**
     * Несравнимы
     */
    public static final ComplexNumCompareType UNCOMPARABLE; // 0

    /**
     * Равны
     */
    public static final ComplexNumCompareType EQUALS; // 1

    /**
     * Первый раньше второго
     */
    public static final ComplexNumCompareType LESS; // 2

    /**
     * Второй раньше первого
     */
    public static final ComplexNumCompareType GREAT; // 3

    /**
     * Не помню, что это...
     */
    public static final ComplexNumCompareType COMPARABLE; // 4


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