Apache.NMS.ActiveMQ.Commands.ActiveMQDestination.CompareTo C# (CSharp) Method

CompareTo() public method

Lets sort by name first then lets sort topics greater than queues
public CompareTo ( ActiveMQDestination that ) : int
that ActiveMQDestination another destination to compare against
return int
        public int CompareTo(ActiveMQDestination that)
        {
            int answer = 0;
            if(physicalName != that.physicalName)
            {
                if(physicalName == null)
                {
                    return -1;
                }
                else if(that.physicalName == null)
                {
                    return 1;
                }
                answer = physicalName.CompareTo(that.physicalName);
            }

            if(answer == 0)
            {
                if(IsTopic)
                {
                    if(that.IsQueue)
                    {
                        return 1;
                    }
                }
                else
                {
                    if(that.IsTopic)
                    {
                        return -1;
                    }
                }
            }
            return answer;
        }

Same methods

ActiveMQDestination::CompareTo ( Object o ) : int