|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavafe.reader.Reader
javafe.reader.CachedReader
escjava.reader.RefinementCachedReader
RefinementCachedReader caches compilation units that have been read, as does its super class. However, before doing so, it retrieves all files of a refinement sequence, combines them and caches the combined result against all of the file names. Thus if any file in the refinement sequence is read again, the refinement combination will be produced.
Reads from GenericFiles with null canonicalIDs are not cached.
Field Summary | |
protected AnnotationHandler |
annotationHandler
The underlying Reader whose results we are caching. |
protected java.util.ArrayList |
refinementSequence
|
Fields inherited from class javafe.reader.CachedReader |
cache, underlyingReader |
Constructor Summary | |
RefinementCachedReader(Reader reader)
Creating a cached version of a Reader: |
Method Summary | |
static GenericFile |
findRefined(java.lang.String[] pkgStrings,
CompilationUnit cu)
|
(package private) CompilationUnit |
getCombinedBinaries(Name pkgName,
java.lang.String[] pkg,
java.util.ArrayList rs)
|
(package private) java.util.ArrayList |
getRefinementSequence(java.lang.String[] pkgStrings,
Identifier type,
CompilationUnit cu,
boolean avoidSpec)
|
CompilationUnit |
isAlreadyRead(GenericFile target)
* Caching methods: * * |
CompilationUnit |
read(GenericFile target,
boolean avoidSpec)
Attempt to read and parse a CompilationUnit from target. |
CompilationUnit |
readRefinements(CompilationUnit cu,
boolean avoidSpec)
|
Methods inherited from class javafe.reader.CachedReader |
flushAll, flushTarget, get, isCached, put |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected AnnotationHandler annotationHandler
protected java.util.ArrayList refinementSequence
Constructor Detail |
public RefinementCachedReader(Reader reader)
Method Detail |
public CompilationUnit isAlreadyRead(GenericFile target)
public CompilationUnit read(GenericFile target, boolean avoidSpec)
By default, we attempt to read only a spec (e.g., specOnly is set in the resulting CompilationUnit) to save time. If avoidSpec is true, we attempt to return a non-spec, although this may not always be possible.
The results of this function (including null results, but not the action of reporting error messages) are cached. Only the value of avoidSpec used the first time a given file is read is used. This may result in a spec being returned unnecessarily when avoidSpec is true.
Target must be non-null.
read
in class CachedReader
public CompilationUnit readRefinements(CompilationUnit cu, boolean avoidSpec)
CompilationUnit getCombinedBinaries(Name pkgName, java.lang.String[] pkg, java.util.ArrayList rs)
java.util.ArrayList getRefinementSequence(java.lang.String[] pkgStrings, Identifier type, CompilationUnit cu, boolean avoidSpec)
public static GenericFile findRefined(java.lang.String[] pkgStrings, CompilationUnit cu)
|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |