当前位置: 首页>>代码示例>>C#>>正文


C# Frame.ScanToFloorFrame方法代码示例

本文整理汇总了C#中Frame.ScanToFloorFrame方法的典型用法代码示例。如果您正苦于以下问题:C# Frame.ScanToFloorFrame方法的具体用法?C# Frame.ScanToFloorFrame怎么用?C# Frame.ScanToFloorFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Frame的用法示例。


在下文中一共展示了Frame.ScanToFloorFrame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PrintSeekState


//.........这里部分代码省略.........
                    {
                        // Fresh TermsEnum; seek to first term:
                        FST<BytesRef>.Arc<BytesRef> arc;
                        if (OuterInstance.Index != null)
                        {
                            arc = OuterInstance.Index.GetFirstArc(Arcs[0]);
                            // Empty string prefix must have an output in the index!
                            Debug.Assert(arc.Final);
                        }
                        else
                        {
                            arc = null;
                        }
                        CurrentFrame = PushFrame(arc, OuterInstance.RootCode, 0);
                        CurrentFrame.LoadBlock();
                    }

                    TargetBeforeCurrentLength = CurrentFrame.Ord;

                    Debug.Assert(!Eof);
                    //if (DEBUG) {
                    //System.out.println("\nBTTR.next seg=" + segment + " term=" + brToString(term) + " termExists?=" + termExists + " field=" + fieldInfo.name + " termBlockOrd=" + currentFrame.state.termBlockOrd + " validIndexPrefix=" + validIndexPrefix);
                    //printSeekState();
                    //}

                    if (CurrentFrame == StaticFrame)
                    {
                        // If seek was previously called and the term was
                        // cached, or seek(TermState) was called, usually
                        // caller is just going to pull a D/&PEnum or get
                        // docFreq, etc.  But, if they then call next(),
                        // this method catches up all internal state so next()
                        // works properly:
                        //if (DEBUG) System.out.println("  re-seek to pending term=" + term.utf8ToString() + " " + term);
                        bool result = SeekExact(Term_Renamed);
                        Debug.Assert(result);
                    }

                    // Pop finished blocks
                    while (CurrentFrame.NextEnt == CurrentFrame.EntCount)
                    {
                        if (!CurrentFrame.IsLastInFloor)
                        {
                            CurrentFrame.LoadNextFloorBlock();
                        }
                        else
                        {
                            //if (DEBUG) System.out.println("  pop frame");
                            if (CurrentFrame.Ord == 0)
                            {
                                //if (DEBUG) System.out.println("  return null");
                                Debug.Assert(SetEOF());
                                Term_Renamed.Length = 0;
                                ValidIndexPrefix = 0;
                                CurrentFrame.Rewind();
                                TermExists = false;
                                return null;
                            }
                            long lastFP = CurrentFrame.FpOrig;
                            CurrentFrame = Stack[CurrentFrame.Ord - 1];

                            if (CurrentFrame.NextEnt == -1 || CurrentFrame.LastSubFP != lastFP)
                            {
                                // We popped into a frame that's not loaded
                                // yet or not scan'd to the right entry
                                CurrentFrame.ScanToFloorFrame(Term_Renamed);
                                CurrentFrame.LoadBlock();
                                CurrentFrame.ScanToSubBlock(lastFP);
                            }

                            // Note that the seek state (last seek) has been
                            // invalidated beyond this depth
                            ValidIndexPrefix = Math.Min(ValidIndexPrefix, CurrentFrame.Prefix);
                            //if (DEBUG) {
                            //System.out.println("  reset validIndexPrefix=" + validIndexPrefix);
                            //}
                        }
                    }

                    while (true)
                    {
                        if (CurrentFrame.Next())
                        {
                            // Push to new block:
                            //if (DEBUG) System.out.println("  push frame");
                            CurrentFrame = PushFrame(null, CurrentFrame.LastSubFP, Term_Renamed.Length);
                            // this is a "next" frame -- even if it's
                            // floor'd we must pretend it isn't so we don't
                            // try to scan to the right floor frame:
                            CurrentFrame.IsFloor = false;
                            //currentFrame.hasTerms = true;
                            CurrentFrame.LoadBlock();
                        }
                        else
                        {
                            //if (DEBUG) System.out.println("  return term=" + term.utf8ToString() + " " + term + " currentFrame.ord=" + currentFrame.ord);
                            return Term_Renamed;
                        }
                    }
                }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:101,代码来源:BlockTreeTermsReader.cs


注:本文中的Frame.ScanToFloorFrame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。