Exemplo n.º 1
0
        //////////////////////////////////////////////////////////////////////////////

        public override int InternalOrder(Obj other)
        {
            Debug.Assert(GetSize() == other.GetSize());

            Obj[]       col, otherCol;
            int         size     = GetSize();
            NeBinRelObj otherRel = (NeBinRelObj)other;

            if (other is RecordObj)
            {
                RecordObj otherRecord = (RecordObj)other;

                ushort[] otherFieldIds = otherRecord.fieldIds;
                if (fieldIds != otherFieldIds)
                {
                    for (int i = 0; i < size; i++)
                    {
                        int res = SymbObj.CompSymbs(fieldIds[i], otherFieldIds[i]);
                        if (res != 0)
                        {
                            return(res);
                        }
                    }
                }
            }
            else
            {
                BuildCol1();

                col      = col1;
                otherCol = otherRel.Col1();
                for (int i = 0; i < size; i++)
                {
                    int ord = col[i].QuickOrder(otherCol[i]);
                    if (ord != 0)
                    {
                        return(ord);
                    }
                }
            }

            col      = col2;
            otherCol = otherRel.Col2();
            for (int i = 0; i < size; i++)
            {
                int ord = col[i].QuickOrder(otherCol[i]);
                if (ord != 0)
                {
                    return(ord);
                }
            }

            return(0);
        }
Exemplo n.º 2
0
        private RecordObj(ushort[] fieldIds, Obj[] values)
        {
            Debug.Assert(fieldIds.Length > 0);
            for (int i = 1; i < fieldIds.Length; i++)
            {
                Debug.Assert(SymbObj.CompSymbs(fieldIds[i - 1], fieldIds[i]) == 1);
            }

            data      = BinRelObjData((uint)fieldIds.Length);
            extraData = NeBinRelObjExtraData();

            this.fieldIds = fieldIds;
            col2          = values;
            isMap         = true;
        }