|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectxjavadoc.filesystem.FileSourceSet
public final class FileSourceSet
This class represents a set of Java source files. It designs a directory and an optional array of files. The size() and getQualifiedName( int ) methods depend on what files were passed in the constructor. The getSourceFile( String ) will work regardless of wether the class was instantiated with files or not (provided the file exists).
Nested Class Summary | |
---|---|
(package private) class |
FileSourceSet.DirectoryFilter
FileFilter that only accepts directories |
(package private) class |
FileSourceSet.JavaSourceFilter
FileFilter that only accepts java sources |
Field Summary | |
---|---|
private java.io.File |
_dir
root directory |
private java.util.ArrayList |
_files
source files |
private int |
hash
overridden hash code |
Constructor Summary | |
---|---|
FileSourceSet(java.io.File fileOrDir)
Creates a SoureSet from a directory or a file. |
|
FileSourceSet(java.io.File dir,
java.lang.String[] files)
Constructs a new FileSourceSet. |
Method Summary | |
---|---|
boolean |
containsAbsolute(java.lang.String filename)
whether source set contains given absolute file name |
boolean |
containsRelative(java.lang.String filename)
whether source set contains relative file name |
boolean |
equals(java.lang.Object o)
Compares with another object. |
private java.io.File |
getDir()
Gets the root directory of the source files. |
AbstractFile[] |
getFiles()
Gets the files contained in the source set. |
java.lang.String |
getQualifiedName(int i)
Gets the fully qualified class name of the i'th file in the instance. |
private java.lang.String |
getQualifiedName(java.lang.String relativeFileName)
Gets the fully qualified class name for a relative file |
private java.lang.String |
getRelativeFileName(java.lang.String qualifiedName)
Gets the relative file name (relative to dir) for a fully qualified class name |
int |
getSize()
Returns the number of files in the instance |
AbstractFile |
getSourceFile(java.lang.String qualifiedName)
Gets the File containing the source of the class. |
int |
hashCode()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.io.File _dir
private java.util.ArrayList _files
private int hash
Constructor Detail |
---|
public FileSourceSet(java.io.File dir, java.lang.String[] files)
dir
- The root directory of the java sourcesfiles
- The desired files under the root directorypublic FileSourceSet(java.io.File fileOrDir)
fileOrDir
- Method Detail |
---|
public AbstractFile[] getFiles()
getFiles
in interface SourceSet
public AbstractFile getSourceFile(java.lang.String qualifiedName)
getSourceFile
in interface SourceSet
qualifiedName
- fully qualified class name of the source file to find.
public java.lang.String getQualifiedName(int i)
getQualifiedName
in interface SourceSet
i
- the index of the class
public int getSize()
getSize
in interface SourceSet
public boolean containsAbsolute(java.lang.String filename)
filename
- absolute filename to check
public boolean containsRelative(java.lang.String filename)
filename
- relative filename to check
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- object to compare
public int hashCode()
hashCode
in class java.lang.Object
private java.io.File getDir()
private java.lang.String getQualifiedName(java.lang.String relativeFileName)
relativeFileName
- filename relative to the dir
private java.lang.String getRelativeFileName(java.lang.String qualifiedName)
qualifiedName
- fully qualified class name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |