Пример #1
0
        public SingleLabel ExtractSingleLabel()
        {
            if (LabelType != LabelType.Simple)
            {
                throw new InvalidOperationException("Cannot extract single label from non simple label type.");
            }

            return(Sublabels.Single());
        }
Пример #2
0
        public bool Equals(Label other)
        {
            if (other == null)
            {
                return(false);
            }

            if (!LabelType.Equals(other.LabelType))
            {
                return(false);
            }

            return(Sublabels.SequenceEqual(other.Sublabels));
        }
Пример #3
0
        public int CompareTo(Label other)
        {
            if (other == null)
            {
                return(1);
            }

            int result = LabelType.CompareTo(other.LabelType);

            if (result != 0)
            {
                return(result);
            }

            return(Sublabels.SequenceCompare(other.Sublabels));
        }