|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.rej.files.ClassIndex
public class ClassIndex
Manages relationships between fully qualified class names and the physical locations of the classfiles they are defined in. Each set of files can be cached to the disk, so that it is not necessary to recreate it at start-up.
Constructor Summary | |
---|---|
ClassIndex()
|
Method Summary | |
---|---|
void |
addElement(FileSet fs)
Add a FileSet to the index and mark the index as being
not up to date. |
void |
addLocator(FileSet fs,
java.lang.String file)
Add a single locator to the index |
void |
conditionalUpdate()
Updates the index if it has been marked as not up to date. |
java.util.List<ClassLocator> |
getAll()
Returns a List containing the ClassLocator of
all the classes in call the FileSet s of this index. |
ClassFile |
getByFullName(java.lang.String name)
Returns the ClassFile |
java.util.List<java.lang.String> |
getClassNames(FileSet fs)
Return a List of all the names classes in the given
FileSet . |
ClassLocator |
getLocator(java.lang.String className)
Return ClassLocator for the given full class name |
void |
removeElement(FileSet current)
Remove one fileset from the index |
void |
removeLocator(FileSet fs,
java.lang.String file)
Remove a single locator from the index. |
void |
update()
Update the index, reading (from cache or disk) all the locators for FileSet s for which there are no index entries yet. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassIndex()
Method Detail |
---|
public void addElement(FileSet fs)
FileSet
to the index and mark the index as being
not up to date. Nothing is loaded at this point. The FileSet
is simply queued for addition.
fs
- fileset to add to the index.public ClassFile getByFullName(java.lang.String name) throws java.io.IOException
ClassFile object for the class whose fully qualified name is
given as a parameter. Or null
if no class is found.
- Parameters:
name
- fully qualified name of the class to return.
- Returns:
ClassFile
of the class name given as a parameter.
- Throws:
java.io.IOException
- I/O Exception while reading/parsing the class.
public java.util.List<ClassLocator> getAll()
List
containing the ClassLocator
of
all the classes in call the FileSet
s of this index.
java.util.List
containing ClassLocator
objects.public void conditionalUpdate()
public void update()
FileSet
s for which there are no index entries yet.
public void removeElement(FileSet current)
current
- public ClassLocator getLocator(java.lang.String className)
className
-
public java.util.List<java.lang.String> getClassNames(FileSet fs)
List
of all the names classes in the given
FileSet
.
fs
- a FileSet
object for which the class names are requested.
List
of String objects.
public void addLocator(FileSet fs, java.lang.String file) throws java.io.IOException
fs
- FileSet
where the file belongs to.file
- name of file to add.
java.io.IOException
- I/O problem while adding.public void removeLocator(FileSet fs, java.lang.String file)
fs
- FileSet
where the file belongs to.file
- name of file to remove.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |