org.jcoderz.phoenix.report
Class ResourceInfo

java.lang.Object
  extended by org.jcoderz.phoenix.report.ResourceInfo

public final class ResourceInfo
extends Object

This class holds resource information about a Java class.

Author:
Michael Griffel

Method Summary
static int countLinesOfCode(String fileName)
          Returns the number of lines for the given file filename.
 boolean equals(Object obj)
          
 String getClassname()
          Returns the class name.
 int getLinesOfCode()
          Returns the linesOfCode.
 String getPackage()
          Returns the package.
 String getResourceName()
          Returns the resourceName.
 String getSourcDir()
          Returns the sourcDir.
 int hashCode()
          
static ResourceInfo lookup(String name)
          Locates the resource with the given name.
static ResourceInfo lookup(String packageName, String className)
          Searches the resource with the given class name and package.
static ResourceInfo register(String name, String pkg, String sourceDir)
          Registers the a new resource with the given parameters.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

register

public static ResourceInfo register(String name,
                                    String pkg,
                                    String sourceDir)
Registers the a new resource with the given parameters.

Parameters:
name - the name of the resource.
pkg - the Java package of the resource.
sourceDir - the source directory of the resource.
Returns:
the registered resource info.

lookup

public static ResourceInfo lookup(String name)
Locates the resource with the given name.

Parameters:
name - resource name.
Returns:
the resource for the given name or null if not found.

lookup

public static ResourceInfo lookup(String packageName,
                                  String className)
Searches the resource with the given class name and package.

Parameters:
packageName - resource package name.
className - resource class name.
Returns:
the resource for the given name or null if not found.

countLinesOfCode

public static int countLinesOfCode(String fileName)
                            throws IOException,
                                   FileNotFoundException
Returns the number of lines for the given file filename.

Parameters:
fileName - the name of the file.
Returns:
the number of lines.
Throws:
IOException - in case of an I/O problem.
FileNotFoundException - in case the named file does not exists or is a directory.

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

getLinesOfCode

public int getLinesOfCode()
Returns the linesOfCode.

Returns:
the linesOfCode.

getPackage

public String getPackage()
Returns the package.

Returns:
the package.

getResourceName

public String getResourceName()
Returns the resourceName.

Returns:
the resourceName.

getSourcDir

public String getSourcDir()
Returns the sourcDir.

Returns:
the sourcDir.

toString

public String toString()

Overrides:
toString in class Object

getClassname

public String getClassname()
Returns the class name.

Returns:
the class name.


Copyright 2007 The jCoderZ Project.