예제 #1
0
        public virtual bool ChkOSubjPredObj(int subj, int pred, int obj)
        {
            if (!Scale.ChkInScale(subj, pred, obj))
            {
                return(false);
            }
            SubjPredObjInt key = new SubjPredObjInt()
            {
                subj = subj, pred = pred, obj = obj
            };
            var entry = otriples.Root.BinarySearchFirst(ent => (new SubjPredObjInt(ent.Get())).CompareTo(key));

            return(!entry.IsEmpty);
        }
예제 #2
0
        public int CompareTo(object sp)
        {
            SubjPredObjInt target = (SubjPredObjInt)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));
        }