public bool ChkOSubjPredObj(string subj, string pred, string obj) { if (!ChkInScale(subj, pred, obj)) { return(false); } SubjPredObj key = new SubjPredObj() { subj = subj, pred = pred, obj = obj }; var entry = otriples.Root.BinarySearchFirst(ent => (new SubjPredObj(ent.Get())).CompareTo(key)); return(!entry.IsEmpty); }
public int CompareTo(object sp) { SubjPredObj target = (SubjPredObj)sp; int cmp = subj.CompareTo(target.subj); if (cmp != 0) { return(cmp); } cmp = pred.CompareTo(target.pred); if (cmp != 0) { return(cmp); } return(obj.CompareTo(target.obj)); }