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

            return(Sublabels.Single());
        }
Beispiel #2
0
        public bool Equals(Label other)
        {
            if (other == null)
            {
                return(false);
            }

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

            return(Sublabels.SequenceEqual(other.Sublabels));
        }
Beispiel #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));
        }