001: /*
002: * Author: Chris Seguin
003: *
004: * This software has been developed under the copyleft
005: * rules of the GNU General Public License. Please
006: * consult the GNU General Public License for more
007: * details about use and distribution of this software.
008: */
009: package org.acm.seguin.metrics;
010:
011: /**
012: * Stores the metrics for a particular method
013: *
014: *@author Chris Seguin
015: *@created July 23, 1999
016: */
017: public class MethodMetrics {
018: /*<Instance Variables>*/
019: private String packageName;
020: private String typeName;
021: private String methodName;
022: private int statementCount;
023: private int parameterCount;
024: private int blockDepth;
025: private int lines;
026:
027: /*</Instance Variables>*/
028:
029: /*<Constructor>*/
030: /**
031: * Constructor for the MethodMetrics object
032: *
033: *@param initPackage The package
034: *@param initType The type
035: *@param initMethod The method
036: */
037: public MethodMetrics(String initPackage, String initType,
038: String initMethod) {
039: packageName = initPackage;
040: typeName = initType;
041: methodName = initMethod;
042: statementCount = 0;
043: parameterCount = 0;
044: blockDepth = 0;
045: lines = 0;
046: }
047:
048: /*</Constructor>*/
049:
050: /*<Getters>*/
051: /**
052: * Return the package name
053: *
054: *@return the package name
055: */
056: public String getPackageName() {
057: return packageName;
058: }
059:
060: /**
061: * Return the type name
062: *
063: *@return The type name
064: */
065: public String getTypeName() {
066: return typeName;
067: }
068:
069: /**
070: * Return the method name
071: *
072: *@return The method name
073: */
074: public String getMethodName() {
075: return methodName;
076: }
077:
078: /**
079: * Return the statement count
080: *
081: *@return The statement count
082: */
083: public int getStatementCount() {
084: return statementCount;
085: }
086:
087: /**
088: * Return the parameter count
089: *
090: *@return The parameter count
091: */
092: public int getParameterCount() {
093: return parameterCount;
094: }
095:
096: public int getLinesOfCode() {
097: return lines;
098: }
099:
100: public int getBlockDepth() {
101: return blockDepth;
102: }
103:
104: /*</Getters>*/
105:
106: /*<Setters>*/
107: /**
108: * Set the statement count
109: *
110: *@param count The statement count
111: */
112: void setStatementCount(int count) {
113: statementCount = count;
114: }
115:
116: /**
117: * Set the parameter count
118: *
119: *@param count The parameter count
120: */
121: void setParameterCount(int count) {
122: parameterCount = count;
123: }
124:
125: void setBlockDepth(int count) {
126: blockDepth = count;
127: }
128:
129: void setLinesOfCode(int count) {
130: lines = count;
131: }
132: /*</Setters>*/
133: }
|