Class NgramMatch

  • All Implemented Interfaces:
    java.io.Serializable

    public class NgramMatch
    extends java.lang.Object
    implements java.io.Serializable
    Contains all data for a single matched pair.

    Contains: Start and end lines for block in reference file, Start and end lines for block in checked file, The float value denoting similarity between the 2 blocks, A pointer to the reference file (File1), A pointer to the checked file (File2).

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      boolean common
      Used to allow skipping during score methods if the math is considered common.
      ISourceFile[] files
      The two files with matching sections.
      java.util.ArrayList<Tuple<java.lang.Integer,​java.lang.Integer>> lines
      The line positions of both blocks.
      float similarity
      The similarity between the section of both files.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(NgramMatch pair)
      Checks if the two stored blocks are the same.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • lines

        public java.util.ArrayList<Tuple<java.lang.Integer,​java.lang.Integer>> lines
        The line positions of both blocks.
      • similarity

        public float similarity
        The similarity between the section of both files.
      • files

        public ISourceFile[] files
        The two files with matching sections.
      • common

        public boolean common
        Used to allow skipping during score methods if the math is considered common. Is now redundant due to depreciation, but has been left in if needed in future use cases.
    • Method Detail

      • equals

        public boolean equals​(NgramMatch pair)
        Checks if the two stored blocks are the same.
        Parameters:
        pair - The match to check for equality.
        Returns:
        True if the blocks are the same.