Esempio n. 1
0
        public static void Traverse(IIndexedNode node, IIntVisitor visitor)
        {
            IEnumerator i = node.GetEnumerator();

            while (i.MoveNext())
            {
                IFieldIndexKey composite = (IFieldIndexKey)i.Current;
                visitor.Visit(composite.ParentID());
            }
        }
Esempio n. 2
0
        public static TreeInt AddToTree(TreeInt tree, IIndexedNode node)
        {
            IEnumerator i = node.GetEnumerator();

            while (i.MoveNext())
            {
                IFieldIndexKey composite = (IFieldIndexKey)i.Current;
                tree = (TreeInt)((TreeInt)Tree.Add(tree, new TreeInt(composite.ParentID())));
            }
            return(tree);
        }
Esempio n. 3
0
        public virtual IPreparedComparison PrepareComparison(IContext context, object fieldIndexKey
                                                             )
        {
            IFieldIndexKey      source = (IFieldIndexKey)fieldIndexKey;
            IPreparedComparison preparedValueComparison = _valueHandler.PrepareComparison(context
                                                                                          , source.Value());
            IPreparedComparison preparedParentIdComparison = _parentIdHandler.NewPrepareCompare
                                                                 (source.ParentID());

            return(new _IPreparedComparison_67(preparedValueComparison, preparedParentIdComparison
                                               ));
        }
Esempio n. 4
0
        public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer writer, object
                                            obj)
        {
            IFieldIndexKey composite = (IFieldIndexKey)obj;
            int            parentID  = composite.ParentID();
            object         value     = composite.Value();

            if (value == null)
            {
                parentID = -parentID;
            }
            _parentIdHandler.Write(parentID, writer);
            _valueHandler.WriteIndexEntry(context, writer, composite.Value());
        }
Esempio n. 5
0
        public virtual IPreparedComparison PrepareComparison(IContext context, object fieldIndexKey
                                                             )
        {
            if (fieldIndexKey == null)
            {
                fieldIndexKey = new FieldIndexKeyImpl(int.MaxValue, null);
            }
            IFieldIndexKey      source = (IFieldIndexKey)fieldIndexKey;
            IPreparedComparison preparedValueComparison = _valueHandler.PrepareComparison(context
                                                                                          , source.Value());
            IPreparedComparison preparedParentIdComparison = _parentIdHandler.NewPrepareCompare
                                                                 (source.ParentID());

            return(new _IPreparedComparison_65(preparedValueComparison, preparedParentIdComparison
                                               ));
        }
Esempio n. 6
0
            public int CompareTo(object obj)
            {
                IFieldIndexKey target = (IFieldIndexKey)obj;

                try
                {
                    int delegateResult = preparedValueComparison.CompareTo(target.Value());
                    if (delegateResult != 0)
                    {
                        return(delegateResult);
                    }
                }
                catch (IllegalComparisonException)
                {
                }
                // can happen, is expected
                return(preparedParentIdComparison.CompareTo(target.ParentID()));
            }
Esempio n. 7
0
        protected override IEnumerator NextIterator(object current)
        {
            IFieldIndexKey key = (IFieldIndexKey)current;

            return(_path.Search(key.ParentID()).Keys());
        }
Esempio n. 8
0
            protected override object Map(object current)
            {
                IFieldIndexKey composite = (IFieldIndexKey)current;

                return(composite.ParentID());
            }
        public HardObjectReference GetHardObjectReferenceBySignature(Transaction transaction
                                                                     , long longPart, byte[] signature)
        {
            IBTreeRange range = Search(transaction, longPart);
            IEnumerator keys  = range.Keys();

            while (keys.MoveNext())
            {
                IFieldIndexKey      current = (IFieldIndexKey)keys.Current;
                HardObjectReference hardRef = GetHardObjectReferenceById(transaction, current.ParentID
                                                                             (), signature);
                if (null != hardRef)
                {
                    return(hardRef);
                }
            }
            return(HardObjectReference.Invalid);
        }