Class CodeBlock
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.module.web.data.models.internal.CodeBlock
-
public class CodeBlock extends java.lang.Object
Code blocks used by the results section of the website
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Compare this code block against another object to see if they matchint
getEndLine()
Get the end line numberint
getMatchId()
Get the match ID linked to this blockint
getStartLine()
Get the start line numberjava.util.List<java.lang.Integer>
toLineNumList()
Generate a list of line numbers between the start and end line numbers (inclusive)
-
-
-
Constructor Detail
-
CodeBlock
public CodeBlock(int startLine, int endLine)
Initialise this code block without a match- Parameters:
startLine
- the start line numberendLine
- the end line number
-
CodeBlock
public CodeBlock(int startLine, int endLine, int matchId)
Initialise this code block with a match- Parameters:
startLine
- the start line numberendLine
- the end line numbermatchId
- the id of the match linked to this block
-
-
Method Detail
-
getStartLine
public int getStartLine()
Get the start line number- Returns:
- the line number
-
getEndLine
public int getEndLine()
Get the end line number- Returns:
- the line number
-
getMatchId
public int getMatchId()
Get the match ID linked to this block- Returns:
- the match ID
-
toLineNumList
public java.util.List<java.lang.Integer> toLineNumList()
Generate a list of line numbers between the start and end line numbers (inclusive)- Returns:
- the list of line numbers
-
equals
public boolean equals(java.lang.Object o)
Compare this code block against another object to see if they match- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- the object to compare against- Returns:
- whether or not the two objects are equal
-
-