Class LineImpl
- java.lang.Object
-
- org.jacoco.core.internal.analysis.LineImpl
-
- All Implemented Interfaces:
ILine
- Direct Known Subclasses:
LineImpl.Fix,LineImpl.Var
public abstract class LineImpl extends java.lang.Object implements ILine
Implementation ofILine.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classLineImpl.FixImmutable version.private static classLineImpl.VarMutable version.
-
Field Summary
Fields Modifier and Type Field Description protected CounterImplbranchesbranch counterstatic LineImplEMPTYEmpty line without instructions or branches.protected CounterImplinstructionsinstruction counterprivate static intSINGLETON_BRA_LIMITMax branch counter value for which singletons are createdprivate static intSINGLETON_INS_LIMITMax instruction counter value for which singletons are createdprivate static LineImpl[][][][]SINGLETONS
-
Constructor Summary
Constructors Modifier Constructor Description privateLineImpl(CounterImpl instructions, CounterImpl branches)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)ICountergetBranchCounter()Returns the branches counter for this line.private static LineImplgetInstance(CounterImpl instructions, CounterImpl branches)ICountergetInstructionCounter()Returns the instruction counter for this line.intgetStatus()Returns the coverage status of this line, calculated from the instructions counter and branch counter.inthashCode()abstract LineImplincrement(ICounter instructions, ICounter branches)Adds the given counters to this line.
-
-
-
Field Detail
-
SINGLETON_INS_LIMIT
private static final int SINGLETON_INS_LIMIT
Max instruction counter value for which singletons are created- See Also:
- Constant Field Values
-
SINGLETON_BRA_LIMIT
private static final int SINGLETON_BRA_LIMIT
Max branch counter value for which singletons are created- See Also:
- Constant Field Values
-
SINGLETONS
private static final LineImpl[][][][] SINGLETONS
-
EMPTY
public static final LineImpl EMPTY
Empty line without instructions or branches.
-
instructions
protected CounterImpl instructions
instruction counter
-
branches
protected CounterImpl branches
branch counter
-
-
Constructor Detail
-
LineImpl
private LineImpl(CounterImpl instructions, CounterImpl branches)
-
-
Method Detail
-
getInstance
private static LineImpl getInstance(CounterImpl instructions, CounterImpl branches)
-
increment
public abstract LineImpl increment(ICounter instructions, ICounter branches)
Adds the given counters to this line.- Parameters:
instructions- instructions to addbranches- branches to add- Returns:
- instance with new counter values
-
getStatus
public int getStatus()
Description copied from interface:ILineReturns the coverage status of this line, calculated from the instructions counter and branch counter.- Specified by:
getStatusin interfaceILine- Returns:
- status of this line
- See Also:
ICounter.EMPTY,ICounter.NOT_COVERED,ICounter.PARTLY_COVERED,ICounter.FULLY_COVERED
-
getInstructionCounter
public ICounter getInstructionCounter()
Description copied from interface:ILineReturns the instruction counter for this line.- Specified by:
getInstructionCounterin interfaceILine- Returns:
- instruction counter
-
getBranchCounter
public ICounter getBranchCounter()
Description copied from interface:ILineReturns the branches counter for this line.- Specified by:
getBranchCounterin interfaceILine- Returns:
- branches counter
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-