Exemplo n.º 1
0
        public Guid[] FindObjects(IndexData indexData, string OIDClass, bool complexExtension, out int?readedObjects)
        {
            int ro;
            StringBinaryTree BT  = getStorageData(indexData);
            List <Guid>      ret = BT.GetObjectsFromBT(OIDClass, out ro);

            readedObjects = ro;

            /*if (complexExtension)
             * {
             *  foreach (string t in BT.GetObjectsTypesFromBT().Where(t => t != OIDClass))
             *  {
             *      bool found = false;
             *      Type baseType = t.BaseType;
             *      while (baseType != null && !found)
             *      {
             *          if (baseType == OIDClass)
             *          {
             *              ret.AddRange(BT.GetObjectsFromBT(OIDClass, out ro));
             *              readedObjects += ro;
             *              found = true;
             *          }
             *          baseType = baseType.BaseType;
             *      }
             *  }
             * }*/

            return(ret.Distinct().ToArray());
        }
Exemplo n.º 2
0
        public Guid[] FindObjects(IndexData indexData, string OIDClass, bool complexExtension, string[] attributes,
                                  object[] values, CompareType[] compareTypes, out int?readedObjects)
        {
            if (compareTypes.Count() != attributes.Count() || attributes.Count() != values.Count())
            {
                throw new ArgumentException(
                          "Liczności tbalic z atrybutami, porównaniami oraz wartościami musza być identyczne!");
            }

            readedObjects = 0;
            int ro;
            StringBinaryTree BT  = getStorageData(indexData);
            List <Guid>      ret = null;

            for (int i = 0; i < attributes.Count(); i++)
            {
                List <Guid> foundOIDs = BT.GetObjectsFromBT(OIDClass, attributes[i], values[i].ToString(), compareTypes[i],
                                                            out ro);
                readedObjects += ro;

                /*if (complexExtension)
                 * {
                 *  foreach (string t in BT.GetObjectsTypesFromBT().Where(t => t != OIDClass))
                 *  {
                 *      bool found = false;
                 *      Type baseType = t.BaseType;
                 *      while (baseType != null && !found)
                 *      {
                 *          if (baseType == OIDClass)
                 *          {
                 *              foundOIDs.AddRange(BT.GetObjectsFromBT(OIDClass, attributes[i], values[i].ToString(),
                 *                                                     compareTypes[i], out ro));
                 *              readedObjects += ro;
                 *              found = true;
                 *          }
                 *          baseType = baseType.BaseType;
                 *      }
                 *  }
                 * }*/

                if (ret == null)
                {
                    ret = foundOIDs.Distinct().ToList();
                }
                else
                {
                    ret =
                        ret.Intersect(foundOIDs.Distinct()).ToList();
                }
            }

            return(ret.ToArray());
        }
Exemplo n.º 3
0
        public IndexData AddObject(IndexData indexData, Oid obj, string[] attributes, QueryParameters queryParameters)
        {
            StringBinaryTree BT = getStorageData(indexData);

            var classOid = GetClassByOID(obj, queryParameters);

            VerifyAttributes(attributes, queryParameters, classOid);

            foreach (String attribute in attributes)
            {
                string attributeValue = GetAttributeValue(attribute, obj, queryParameters);
                BT.AddToBTvalue(obj, classOid.Name, attribute, attributeValue);
            }

            return(BT);
        }
Exemplo n.º 4
0
        public string[] GetIndexedAttribiutesForType(IndexData indexData, string t)
        {
            StringBinaryTree BT = getStorageData(indexData);

            return(BT.GetAttributesForTypeFromBT(t));
        }
Exemplo n.º 5
0
        public Guid[] GetIndexedObjects(IndexData indexData, int?packageSize, int skipItemsCount)
        {
            StringBinaryTree BT = getStorageData(indexData);

            return(BT.GetObjectsFromBT());
        }