USING Progress.Collections.IComparable FROM PROPATH.

CLASS MultipleImplements
    IMPLEMENTS IComparable<OpenEdge.Core.Integer>,
               IComparable<OpenEdge.Core.Decimal>:

    DEFINE PUBLIC PROPERTY IntVal AS OpenEdge.Core.Integer NO-UNDO GET. SET.
    DEFINE PUBLIC PROPERTY DecVal AS OpenEdge.Core.Decimal NO-UNDO GET. SET.

    CONSTRUCTOR PUBLIC MultipleImplements():
    END CONSTRUCTOR.

    CONSTRUCTOR PUBLIC MultipleImplements(ipInt AS OpenEdge.Core.Integer, ipDec AS OpenEdge.Core.Decimal):
        ASSIGN
            IntVal  = ipInt
            DecVal = ipDec.
    END CONSTRUCTOR.

    METHOD PUBLIC INTEGER CompareTo(other AS OpenEdge.Core.Integer):
        IF other = ? THEN RETURN 1.
        IF IntVal:Value = other:Value THEN RETURN 0.
        IF IntVal:Value < other:Value THEN RETURN -1.
        RETURN 1.
    END METHOD.
    
    METHOD PUBLIC INTEGER CompareTo(other AS OpenEdge.Core.Decimal):
        IF other = ? THEN RETURN 1.
        IF DecVal:Value = other:Value THEN RETURN 0.
        IF DecVal:Value < other:Value THEN RETURN -1.
        RETURN 1.
    END METHOD.


END CLASS.
