public SingleLabel ExtractSingleLabel() { if (LabelType != LabelType.Simple) { throw new InvalidOperationException("Cannot extract single label from non simple label type."); } return(Sublabels.Single()); }
public bool Equals(Label other) { if (other == null) { return(false); } if (!LabelType.Equals(other.LabelType)) { return(false); } return(Sublabels.SequenceEqual(other.Sublabels)); }
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)); }