|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.berkeley.guir.lib.metrics.CodeCounter
Runs some simple metrics on your code, like number of methods, number of logical lines of code, etc.
This software is distributed under the Berkeley Software License.
Revisions: - GUIRLib-v1.0-1.0.0, Apr 15 1997, JH Created class - GUIRLib-v1.2-1.0.0, Jun 22 2000, JH Touched for GUIRLib release - GUIRLib-v1.3-1.0.0, Aug 11 2000, JH Touched for GUIRLib release - GUIRLib-v1.4-1.0.0, Aug 31 2000, JH Touched for GUIRLib release
Field Summary | |
static String |
BEGIN_TOKEN
|
static String |
COMMENT_BEGIN
|
static String |
COMMENT_CONTINUE
|
static String |
COMMENT_END
|
static String |
COMMENT_EOLN
|
static String |
END_TOKEN
|
static int |
METHOD_DEPTH
|
static String |
STATEMENT_END
|
Constructor Summary | |
CodeCounter(String strFileName)
Constructor. |
Method Summary | |
static int |
countOccurrencesOfCharacter(char chSearch,
String strLine)
Count the number of occurrences of a character in a String. |
static int |
countOccurrencesOfString(String strSearch,
String strLine)
Count the number of occurrences of a String in a String. |
int |
getLinesOfComments()
Get the number of lines of comments in the source code. |
int |
getLinesOfLogicalCode()
Get the number of lines of logical code in the source code. |
int |
getLinesOfPhysicalCode()
Get the number of lines of physical code in the source code. |
int |
getNumMethods()
Get the number of methods in the source code. |
static void |
main(String[] argv)
|
static String |
removeSubstring(char chFrom,
char chTo,
String strLine)
Remove all characters from a String starting from the first location of one character to the first location of another character. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String BEGIN_TOKEN
public static final String END_TOKEN
public static final String COMMENT_EOLN
public static final String COMMENT_BEGIN
public static final String COMMENT_CONTINUE
public static final String COMMENT_END
public static final String STATEMENT_END
public static final int METHOD_DEPTH
Constructor Detail |
public CodeCounter(String strFileName)
strFilename
- is the name of the file to open.Method Detail |
public static int countOccurrencesOfCharacter(char chSearch, String strLine)
chSearch
- is the character to search for.strLine
- is the String to search through.public static int countOccurrencesOfString(String strSearch, String strLine)
strSearch
- is the String to search for.strLine
- is the String to search through.public static String removeSubstring(char chFrom, char chTo, String strLine)
chFrom
- is the character to start deleting from.chTo
- is the character to end deleting.strLine
- is the String to remove characters from.public int getLinesOfComments()
public int getLinesOfLogicalCode()
public int getLinesOfPhysicalCode()
public int getNumMethods()
public String toString()
toString
in class Object
public static void main(String[] argv)
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |