Class CodeBlock


  • public class CodeBlock
    extends java.lang.Object
    Code blocks used by the results section of the website
    • Constructor Summary

      Constructors 
      Constructor Description
      CodeBlock​(int startLine, int endLine)
      Initialise this code block without a match
      CodeBlock​(int startLine, int endLine, int matchId)
      Initialise this code block with a match
    • 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 match
      int getEndLine()
      Get the end line number
      int getMatchId()
      Get the match ID linked to this block
      int getStartLine()
      Get the start line number
      java.util.List<java.lang.Integer> toLineNumList()
      Generate a list of line numbers between the start and end line numbers (inclusive)
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CodeBlock

        public CodeBlock​(int startLine,
                         int endLine)
        Initialise this code block without a match
        Parameters:
        startLine - the start line number
        endLine - 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 number
        endLine - the end line number
        matchId - 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 class java.lang.Object
        Parameters:
        o - the object to compare against
        Returns:
        whether or not the two objects are equal