Beispiel #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);
 }
Beispiel #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());
        }