Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## xjavadoc.filesystem
Class FileSourceSet

    java.lang.Object
      xjavadoc.filesystem.FileSourceSet

All Implemented Interfaces:
  Serializable, SourceSet

public final class FileSourceSet
extends Object
implements SourceSet

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).

Author:
  Aslak Hellesøy
See Also:
  Serialized Form

Nested Class Summary
`(package private) class` | `FileSourceSet.DirectoryFilter` FileFilter that only accepts directories
`(package private) class` | `FileSourceSet.JavaSourceFilter` FileFilter that only accepts java sources

Constructor Summary
`FileSourceSet(File fileOrDir)` Creates a SoureSet from a directory or a file.
`FileSourceSet(File dir, String[] files)` Constructs a new FileSourceSet.

Method Summary
`boolean` | `containsAbsolute(String filename)` whether source set contains given absolute file name
`boolean` | `containsRelative(String filename)` whether source set contains relative file name
`boolean` | `equals(Object o)` Compares with another object.
`AbstractFile[]` | `getFiles()` Gets the files contained in the source set.
`String` | `getQualifiedName(int i)` Gets the fully qualified class name of the i'th file in the instance.
`int` | `getSize()` Returns the number of files in the instance
`AbstractFile` | `getSourceFile(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`

Constructor Detail

### FileSourceSet

    public FileSourceSet(File dir,
                         String[] files)

  Constructs a new FileSourceSet. If the files parameter is null, the FileSourceSet will report that it does not know about any java source files, even if they exist. See the general class comment.

Parameters:
  `dir` - The root directory of the java sources
  `files` - The desired files under the root directory

### FileSourceSet

    public FileSourceSet(File fileOrDir)

  Creates a SoureSet from a directory or a file. If fileOrDir is a directory, all java files under that directory (and all subdirectories) will be added to this FileSourceSet.

Parameters:
  `fileOrDir` -

Method Detail

### getFiles

    public AbstractFile[] getFiles()

  Gets the files contained in the source set.

  Specified by:
    `getFiles` in interface `SourceSet`
  Returns:

### getSourceFile

    public AbstractFile getSourceFile(String qualifiedName)

  Gets the File containing the source of the class.
  IMPORTANT: This method will find a file regardless of whether it was part of the files passed in the constructor.

  Specified by:
    `getSourceFile` in interface `SourceSet`
  Parameters:
    `qualifiedName` - fully qualified class name of the source file to find.
  Returns:
    the File containing the source of the class

### getQualifiedName

    public String getQualifiedName(int i)

  Gets the fully qualified class name of the i'th file in the instance.

  Specified by:
    `getQualifiedName` in interface `SourceSet`
  Parameters:
    `i` - the index of the class
  Returns:
    fully qualified class name

### getSize

    public int getSize()

  Returns the number of files in the instance

  Specified by:
    `getSize` in interface `SourceSet`
  Returns:
    the number of files in the instance

### containsAbsolute

    public boolean containsAbsolute(String filename)

  whether source set contains given absolute file name

  Parameters:
    `filename` - absolute filename to check
  Returns:

### containsRelative

    public boolean containsRelative(String filename)

  whether source set contains relative file name

  Parameters:
    `filename` - relative filename to check
  Returns:

### equals

    public boolean equals(Object o)

  Compares with another object. They are equal if o is a FileSourceSet and have the same dir and the same files.

  Parameters:
    `o` - object to compare
  Returns:
    true if they are equal

### hashCode

    public int hashCode()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2004 XDoclet Team. All Rights Reserved.