net.sourceforge.groboutils.codecoverage.v2.datastore
Class ClassRecord

java.lang.Object
  extended bynet.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord

public class ClassRecord
extends java.lang.Object

Contains data associated with a parsed class. Each class is associated with a collection of analysis modules' marks.

Since:
December 15, 2002
Version:
$Date: 2004/04/15 05:48:26 $
Author:
Matt Albrecht groboclown@users.sourceforge.net

Constructor Summary
ClassRecord(java.lang.String className, long classCRC, java.lang.String sourceFileName, java.lang.String[] methSigs, AnalysisModuleSet ams)
           
 
Method Summary
 void addMark(MarkRecord mr)
          Adds a mark record, and ensures that it is unique upon insertion.
 AnalysisModuleSet getAnalysisModuleSet()
          Returns a copy of the internal analysis module set.
 long getClassCRC()
          Returns the cyclic redundancy check (CRC) for the class in this record.
 java.lang.String getClassName()
          Gets the name of the corresponding class for this record.
 java.lang.String getClassSignature()
          Returns the implementation-specific class signature for the class this record refers to.
 MarkRecord[] getMarksForAnalysisModule(IAnalysisModule am)
           
 MarkRecord[] getMarksForAnalysisModule(java.lang.String measureName)
           
 java.lang.String getMethodAt(short index)
          Returns the method signature at the given index.
 int getMethodCount()
          Returns the total number of method signatures for this class.
 short getMethodIndex(java.lang.String methodSignature)
          Returns the index (as a short) for the given method signature.
 java.lang.String[] getMethods()
          Returns a list of known method signatures for this class.
 java.lang.String getSourceFileName()
          Returns the name of the Java source file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassRecord

public ClassRecord(java.lang.String className,
                   long classCRC,
                   java.lang.String sourceFileName,
                   java.lang.String[] methSigs,
                   AnalysisModuleSet ams)
Method Detail

getClassName

public java.lang.String getClassName()
Gets the name of the corresponding class for this record.

Returns:
the class name.

getClassCRC

public long getClassCRC()
Returns the cyclic redundancy check (CRC) for the class in this record.

Returns:
the class CRC.

getClassSignature

public java.lang.String getClassSignature()
Returns the implementation-specific class signature for the class this record refers to. It should be a String which is unique for this class, even if multiple class files have the same class name (note that if the class files are identical, it makes perfect sense to return identical signatures).

Returns:
the unique signature for the class in this record.

getSourceFileName

public java.lang.String getSourceFileName()
Returns the name of the Java source file.

Returns:
the source file name

getAnalysisModuleSet

public AnalysisModuleSet getAnalysisModuleSet()
Returns a copy of the internal analysis module set.

Returns:
a copy of the set of analysis modules.

getMethods

public java.lang.String[] getMethods()
Returns a list of known method signatures for this class.

Returns:
all method signatures known for this class, in the correct sorted order.

getMethodIndex

public short getMethodIndex(java.lang.String methodSignature)
Returns the index (as a short) for the given method signature. If the signature is not registered, then -1 will be returned.

Parameters:
methodSignature - the signature to find the corresponding index for in this class.
Returns:
the index for methodSignature if it is in this method, or -1 if it is not in the list.
Throws:
java.lang.IllegalArgumentException - if methodSignature is null.

getMethodCount

public int getMethodCount()
Returns the total number of method signatures for this class.

Returns:
the method signature count.

getMethodAt

public java.lang.String getMethodAt(short index)
Returns the method signature at the given index.

Parameters:
index - the index of the method signature to find.
Returns:
the method signature at index index.
Throws:
java.lang.IllegalArgumentException - if index is not within the bounds of [0 .. getMethodCount()-1 ].

addMark

public void addMark(MarkRecord mr)
Adds a mark record, and ensures that it is unique upon insertion.

Parameters:
mr - the new mark to add. Adding this mark will complete its internal data structure.

getMarksForAnalysisModule

public MarkRecord[] getMarksForAnalysisModule(java.lang.String measureName)

getMarksForAnalysisModule

public MarkRecord[] getMarksForAnalysisModule(IAnalysisModule am)


Copyright © 2001-2003 by The GroboUtils Project