polyglot.types
Class CachingResolver

java.lang.Object
  extended bypolyglot.types.CachingResolver
All Implemented Interfaces:
Resolver

public class CachingResolver
extends java.lang.Object
implements Resolver

An CachingResolver memoizes another Resolver


Constructor Summary
CachingResolver(Resolver inner, ExtensionInfo extInfo)
          Create a caching resolver.
 
Method Summary
 Type checkType(java.lang.String name)
          Check if a type is in the cache, returning null if not.
 Named find(java.lang.String name)
          Find a type object by name.
 Resolver inner()
          The resolver whose results this resolver caches.
 void install(java.lang.String name, Qualifier q)
          Install a qualifier in the cache.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CachingResolver

public CachingResolver(Resolver inner,
                       ExtensionInfo extInfo)
Create a caching resolver.

Parameters:
inner - The resolver whose results this resolver caches.
Method Detail

inner

public Resolver inner()
The resolver whose results this resolver caches.


toString

public java.lang.String toString()

find

public Named find(java.lang.String name)
           throws SemanticException
Find a type object by name.

Specified by:
find in interface Resolver
Parameters:
name - The name to search for.
Throws:
SemanticException

checkType

public Type checkType(java.lang.String name)
Check if a type is in the cache, returning null if not.

Parameters:
name - The name to search for.

install

public void install(java.lang.String name,
                    Qualifier q)
Install a qualifier in the cache.

Parameters:
name - The name of the qualifier to insert.
q - The qualifier to insert.