<commit_before>package name.abuchen.portfolio.model;

import java.util.Objects;
import java.util.Optional;

import name.abuchen.portfolio.money.Values;

public class LimitPrice implements Comparable<LimitPrice>
{
    public enum RelationalOperator
    {
        GREATER_OR_EQUAL(">="), //$NON-NLS-1$
        SMALLER_OR_EQUAL("<="), //$NON-NLS-1$
        GREATER(">"), //$NON-NLS-1$
        SMALLER("<"); //$NON-NLS-1$

        private String operatorString;

        RelationalOperator(String operator)
        {
            this.operatorString = operator;
        }

        public String getOperatorString()
        {
            return operatorString;
        }

        public boolean isGreater()
        {
            return this == GREATER_OR_EQUAL || this == GREATER;
        }

        public static Optional<RelationalOperator> findByOperator(String op)
        {
            for (RelationalOperator t : RelationalOperator.values())
            {
                if (t.getOperatorString().equals(op))
                    return Optional.of(t);
            }

            return Optional.empty();
        }
    }

    private RelationalOperator operator = null;
    private long value;

    public LimitPrice(RelationalOperator operator, long value)
    {
        this.operator = Objects.requireNonNull(operator);
        this.value = value;
    }

    public RelationalOperator getRelationalOperator()
    {
        return operator;
    }

    public long getValue()
    {
        return value;
    }

    @Override
    public int hashCode()
    {
        return Objects.hash(operator, value);
    }

    @Override
    public boolean equals(Object obj)
    {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;

        LimitPrice other = (LimitPrice) obj;
        if (value != other.value)
            return false;
        return operator == other.operator;
    }

    @Override
    public int compareTo(LimitPrice other)
    {
        int compare = operator.getOperatorString().compareTo(other.getRelationalOperator().getOperatorString());
        if (compare != 0)
            return compare;
        return (int) (value - other.getValue());
    }<commit_msg>fix sorting of limit price column<commit_after>package name.abuchen.portfolio.model;

import java.util.Objects;
import java.util.Optional;

import name.abuchen.portfolio.money.Values;

public class LimitPrice implements Comparable<LimitPrice>
{
    public enum RelationalOperator
    {
        GREATER_OR_EQUAL(">="), //$NON-NLS-1$
        SMALLER_OR_EQUAL("<="), //$NON-NLS-1$
        GREATER(">"), //$NON-NLS-1$
        SMALLER("<"); //$NON-NLS-1$

        private String operatorString;

        RelationalOperator(String operator)
        {
            this.operatorString = operator;
        }

        public String getOperatorString()
        {
            return operatorString;
        }

        public boolean isGreater()
        {
            return this == GREATER_OR_EQUAL || this == GREATER;
        }

        public static Optional<RelationalOperator> findByOperator(String op)
        {
            for (RelationalOperator t : RelationalOperator.values())
            {
                if (t.getOperatorString().equals(op))
                    return Optional.of(t);
            }

            return Optional.empty();
        }
    }

    private RelationalOperator operator = null;
    private long value;

    public LimitPrice(RelationalOperator operator, long value)
    {
        this.operator = Objects.requireNonNull(operator);
        this.value = value;
    }

    public RelationalOperator getRelationalOperator()
    {
        return operator;
    }

    public long getValue()
    {
        return value;
    }

    @Override
    public int hashCode()
    {
        return Objects.hash(operator, value);
    }

    @Override
    public boolean equals(Object obj)
    {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;

        LimitPrice other = (LimitPrice) obj;
        if (value != other.value)
            return false;
        return operator == other.operator;
    }

    @Override
    public int compareTo(LimitPrice other)
    {
        int compare = operator.getOperatorString().compareTo(other.getRelationalOperator().getOperatorString());
        if (compare != 0)
            return compare;
        return Long.compare(value, other.getValue());
    }
{'fraction_non_alphanumeric': 0.10232457093200087, 'fraction_numerical': 0.0021724961981316533, 'mean_word_length': 1.9550706033376124, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '7322464', 'n_tokens_mistral': 1279, 'n_tokens_neox': 1220, 'n_words': 286}