org.metasyntactic.tool.codecounter
Class JavaSource
java.lang.Object
|
+--org.metasyntactic.tool.codecounter.JavaSource
- public class JavaSource
- extends java.lang.Object
JavaSource --- An object representing one Java source file.
Used by JavaSourceCounter or other drivers wanting manipulation of source objects.
Field Summary |
java.util.Vector |
classes
|
java.lang.String |
name
|
Constructor Summary |
JavaSource(java.io.InputStream input,
java.lang.String fileName)
Creates a JavaSource object, which represents one Java source file. |
Method Summary |
int |
classes()
|
int |
linesOfCode()
Returns the total lines of code in this JavaSource. |
int |
methods()
|
java.lang.String |
toString()
Returns the current contents of JavaSource as a string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
classes
public java.util.Vector classes
name
public java.lang.String name
JavaSource
public JavaSource(java.io.InputStream input,
java.lang.String fileName)
throws java.io.IOException
- Creates a JavaSource object, which represents one Java source file.
- Parameters:
input
- An InputStream representing the java source.
- Throws:
java.io.IOException
- When input is not found or readable.
linesOfCode
public int linesOfCode()
- Returns the total lines of code in this JavaSource.
classes
public int classes()
- Returns:
- The number of classes in this JavaSource as an int.
methods
public int methods()
- Returns:
- The total number of methods in this JavaSource as an int.
toString
public java.lang.String toString()
- Returns the current contents of JavaSource as a string.
- Overrides:
toString
in class java.lang.Object