org.sonar.duplications.block
Class Block

java.lang.Object
  extended by org.sonar.duplications.block.Block

public final class Block
extends Object

Represents part of source code between two lines. If two blocks have the same hash, then we assume that there is a duplication in a code, which they represent.


Constructor Summary
Block(int indexInFile, int firstLineNumber, int lastLineNumber, String resourceId, String hash)
           
Block(String resourceId, ByteArray blockHash, int indexInFile, int firstLineNumber, int lastLineNumber)
           
 
Method Summary
 boolean equals(Object obj)
           
 ByteArray getBlockHash()
           
 int getFirstLineNumber()
           
 String getHashHex()
           
 int getIndexInFile()
           
 int getLastLineNumber()
           
 String getResourceId()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Block

public Block(String resourceId,
             ByteArray blockHash,
             int indexInFile,
             int firstLineNumber,
             int lastLineNumber)

Block

public Block(int indexInFile,
             int firstLineNumber,
             int lastLineNumber,
             String resourceId,
             String hash)
Method Detail

getHashHex

public String getHashHex()

getResourceId

public String getResourceId()

getBlockHash

public ByteArray getBlockHash()

getIndexInFile

public int getIndexInFile()

getFirstLineNumber

public int getFirstLineNumber()

getLastLineNumber

public int getLastLineNumber()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2012 SonarSource. All Rights Reserved.