Class FileMatch
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.module.web.data.models.internal.FileMatch
-
public class FileMatch extends java.lang.ObjectStores the details of a match between two files
-
-
Constructor Summary
Constructors Constructor Description FileMatch(SubmissionMatch match)Initialise this match
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<CodeBlock>getCodeBlocks(ISourceFile file)Get the list of code blocks for a filejava.lang.StringgetColour()Get the highlight CSS colourjava.lang.StringgetFileLines(ISourceFile file)Get a string listing all the line numbers involved from the fileintgetId()Get the id of this matchjava.util.Map<ISourceFile,java.util.List<CodeBlock>>getMap()Get the mapjava.lang.StringgetReason()Get the reason for this matchfloatgetScore()Get the score for this matchvoidsetId(int id)Set the id for this match, also updates the colourorg.json.JSONObjecttoJSON()Convert this object to a JSON object, used by the JavaScript in the UI
-
-
-
Constructor Detail
-
FileMatch
public FileMatch(SubmissionMatch match)
Initialise this match- Parameters:
match- the engine match to initialise this object with
-
-
Method Detail
-
getMap
public java.util.Map<ISourceFile,java.util.List<CodeBlock>> getMap()
Get the map- Returns:
- the map
-
getCodeBlocks
public java.util.List<CodeBlock> getCodeBlocks(ISourceFile file)
Get the list of code blocks for a file- Parameters:
file- the file to get the blocks for- Returns:
- the list
-
getReason
public java.lang.String getReason()
Get the reason for this match- Returns:
- the reason text
-
getScore
public float getScore()
Get the score for this match- Returns:
- the score
-
getColour
public java.lang.String getColour()
Get the highlight CSS colour- Returns:
- the colour
-
getId
public int getId()
Get the id of this match- Returns:
- the id
-
setId
public void setId(int id)
Set the id for this match, also updates the colour- Parameters:
id- the new id
-
getFileLines
public java.lang.String getFileLines(ISourceFile file)
Get a string listing all the line numbers involved from the file- Parameters:
file- the file to get the list for- Returns:
- the comma separated list
-
toJSON
public org.json.JSONObject toJSON()
Convert this object to a JSON object, used by the JavaScript in the UI- Returns:
- the JSON equivalent of this object
-
-