public class CoverageNodeImpl extends Object implements ICoverageNode
ICoverageNode.CounterEntity, ICoverageNode.ElementType
Modifier and Type | Field and Description |
---|---|
protected CounterImpl |
branchCounter
Counter for branches.
|
protected CounterImpl |
classCounter
Counter for classes.
|
protected CounterImpl |
complexityCounter
Counter for complexity.
|
protected CounterImpl |
instructionCounter
Counter for instructions.
|
protected CounterImpl |
lineCounter
Counter for lines
|
protected CounterImpl |
methodCounter
Counter for methods.
|
Constructor and Description |
---|
CoverageNodeImpl(ICoverageNode.ElementType elementType,
String name)
Creates a new coverage data node.
|
Modifier and Type | Method and Description |
---|---|
ICounter |
getBranchCounter()
Returns the counter for branches.
|
ICounter |
getClassCounter()
Returns the counter for classes.
|
ICounter |
getComplexityCounter()
Returns the counter for cyclomatic complexity.
|
ICounter |
getCounter(ICoverageNode.CounterEntity entity)
Generic access to the the counters.
|
ICoverageNode.ElementType |
getElementType()
Returns the type of element represented by this node.
|
ICounter |
getInstructionCounter()
Returns the counter for byte code instructions.
|
ICounter |
getLineCounter()
Returns the counter for lines.
|
ICounter |
getMethodCounter()
Returns the counter for methods.
|
String |
getName()
Returns the name of this node.
|
ICoverageNode |
getPlainCopy()
Creates a plain copy of this node.
|
void |
increment(Collection<? extends ICoverageNode> children)
Increments the counters by the values given by the collection of
elements.
|
void |
increment(ICoverageNode child)
Increments the counters by the values given by another element.
|
String |
toString() |
protected CounterImpl branchCounter
protected CounterImpl instructionCounter
protected CounterImpl lineCounter
protected CounterImpl complexityCounter
protected CounterImpl methodCounter
protected CounterImpl classCounter
public CoverageNodeImpl(ICoverageNode.ElementType elementType, String name)
elementType
- type of the element represented by this instancename
- name of this nodepublic void increment(ICoverageNode child)
child
- counters to addpublic void increment(Collection<? extends ICoverageNode> children)
children
- list of nodes, which counters will be added to this nodepublic ICoverageNode.ElementType getElementType()
ICoverageNode
getElementType
in interface ICoverageNode
public String getName()
ICoverageNode
getName
in interface ICoverageNode
public ICounter getInstructionCounter()
ICoverageNode
getInstructionCounter
in interface ICoverageNode
public ICounter getBranchCounter()
ICoverageNode
getBranchCounter
in interface ICoverageNode
public ICounter getLineCounter()
ICoverageNode
getLineCounter
in interface ICoverageNode
public ICounter getComplexityCounter()
ICoverageNode
getComplexityCounter
in interface ICoverageNode
public ICounter getMethodCounter()
ICoverageNode
getMethodCounter
in interface ICoverageNode
public ICounter getClassCounter()
ICoverageNode
getClassCounter
in interface ICoverageNode
public ICounter getCounter(ICoverageNode.CounterEntity entity)
ICoverageNode
getCounter
in interface ICoverageNode
entity
- entity we're we want to have the counter forpublic ICoverageNode getPlainCopy()
ICoverageNode
ICoverageNode
implementations may contain heavy data structures, the copy returned by
this method is reduced to the counters only. This helps to save memory
while processing huge structures.getPlainCopy
in interface ICoverageNode
Copyright © 2013. All Rights Reserved.