Class FileMatch


  • public class FileMatch
    extends java.lang.Object
    Stores the details of a match between two files
    • 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 file
      java.lang.String getColour()
      Get the highlight CSS colour
      java.lang.String getFileLines​(ISourceFile file)
      Get a string listing all the line numbers involved from the file
      int getId()
      Get the id of this match
      java.util.Map<ISourceFile,​java.util.List<CodeBlock>> getMap()
      Get the map
      java.lang.String getReason()
      Get the reason for this match
      float getScore()
      Get the score for this match
      void setId​(int id)
      Set the id for this match, also updates the colour
      org.json.JSONObject toJSON()
      Convert this object to a JSON object, used by the JavaScript in the UI
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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