Ejemplo n.º 1
0
 protected internal override void setBestToken(Token token, SearchState state)
 {
     TokenHeapSearchManager.TokenHeap tokenHeap = (TokenHeapSearchManager.TokenHeap) this.bestTokenMap.get(state);
     if (tokenHeap == null)
     {
         tokenHeap = new TokenHeapSearchManager.TokenHeap(this, 3);
         this.bestTokenMap.put(state, tokenHeap);
     }
     tokenHeap.add(token);
 }
Ejemplo n.º 2
0
        protected internal override Token getBestToken(SearchState state)
        {
            TokenHeapSearchManager.TokenHeap tokenHeap = (TokenHeapSearchManager.TokenHeap) this.bestTokenMap.get(state);
            if (tokenHeap == null)
            {
                return(null);
            }
            Token result;

            if ((result = tokenHeap.get(state)) != null)
            {
                return(result);
            }
            if (!tokenHeap.isFull())
            {
                return(null);
            }
            return(tokenHeap.getSmallest());
        }