Tabnine Logo
jplag
Code IndexAdd Tabnine to your IDE (free)

How to use jplag

Best Java code snippets using jplag (Showing top 20 results out of 315)

origin: stackoverflow.com

var encoder = new GIFEncoder();
encoder.setRepeat(0);  //0  -> loop forever, 1+ -> loop n times then stop
encoder.setDelay(500); //go to next frame every n milliseconds
origin: jplag/jplag

public final float percentBasecodeA(){
 float sa = subA.size() - subA.files.length;
 return bcmatchesA.tokensMatched() * 100 / sa;
}
public final float percentBasecodeB(){
origin: jplag/jplag

public final float percentA() {
  int divisor;
  if(bcmatchesA != null) divisor = subA.size()-subA.files.length-bcmatchesA.tokensMatched();
 else divisor = subA.size()-subA.files.length;
 return (divisor == 0 ? 0f : (tokensMatched()*100 / (float) divisor));
}
public final float percentB() {
origin: jplag/jplag

public final AllMatches compare(Submission subA, Submission subB) {
  Submission A, B, tmp;
  if (subA.struct.size() > subB.struct.size()) {
    A = subB;  B = subA;
  } else {
    A = subB;  B = subA;
  }
  // if hashtable exists in first but not in second structure: flip around!
  if (B.struct.table == null && A.struct.table != null) {
    tmp = A;
    A = B;
    B = tmp;
  }
  return compare(A, B, this.program.get_min_token_match());
}
origin: jplag/jplag

public final AllBasecodeMatches compareWithBasecode(Submission subA, Submission subB) {
  Submission A, B, tmp;
  if (subA.struct.size() > subB.struct.size()) {
    A = subB;  B = subA;
  } else {
    A = subB;  B = subA;
  }
  // if hashtable exists in first but not in second structure: flip around!
  if (B.struct.table == null && A.struct.table != null) {
    tmp = A;
    A = B;
    B = tmp;
  }
  return compareWithBasecode(A, B, this.program.get_min_token_match());
}
origin: jplag/jplag

private int writeTop(int i, AllMatches match) throws jplag.ExitException {
  HTMLFile f = openHTMLFile(root, "match" + i + "-top.html");
  writeHTMLHeaderWithScript(f, "Top");
  f.println("<BODY BGCOLOR=\"#ffffff\">");
  if (this.program.use_externalSearch()) {
    f.println("<A HREF=\"match" + i + "-dist.html\" TARGET=\"_top\">" + msg.getString("Report.Distribution") + "</A><P>");
  }
  match.HTMLreport(f, i, this.program);
  f.println("</BODY>\n</HTML>\n");
  f.close();
  return f.bytesWritten();
}
origin: jplag/jplag

  public void resetBaseSubmission(Submission sub){
    Structure tmpStruct = sub.struct;
    Token[] tok = tmpStruct.tokens;
    for (int z = 0; z < tmpStruct.size()-1;z++){
      tok[z].basecode = false;
    }
  }
}
origin: jplag/jplag

 public String toString()
 {
  return "{\"" + getText() + "\", <" + getType() + ">, " +
   getLine() + " " + getColumn() + "}";
 }
}
origin: jplag/jplag

private int writeDist(int i, AllMatches match) throws jplag.ExitException {
  HTMLFile f = openHTMLFile(root, "match" + i + "-dist.html");
  writeHTMLHeader(f, msg.getString("Report.Token_Distribution"));
  f.println("<BODY>");
  match.distributionReport(f, msg);
  f.println("</BODY>\n</HTML>");
  f.close();
  return f.bytesWritten();
}
origin: jplag/jplag

public final void addMatch(int startA, int startB, int length) {
 for (int i=anzahl-1; i>=0; i--) { // starting at the end is better(?)
  if (matches[i].overlap(startA,startB,length)) return;
                  // no overlaps!
 }
 ensureCapacity(anzahl + 1);
 //if (matches[anzahl] != null)  // object recycling...
 matches[anzahl].set(startA,startB,length);
 //else
 //matches[anzahl ] = new Match(startA,startB,length);
 anzahl++;
}
origin: jplag/jplag

public Token(int type, String file, int line, int column, int length) {
  this.type = type;
  this.file = file;
  setLine(line>0 ? line : 1);
  setColumn(column);
  setLength(length);
}

origin: jplag/jplag

public final float percentMaxAB() {
  float a=percentA();
  float b=percentB();
  if(a>b) return a;
  else return b;
}
origin: jplag/jplag

public short findCharString(short index, byte b) {
  int hshidx, nxtidx;
  if (index == HASH_FREE)
    return b;
  hshidx = Hash(index, b);
  while ((nxtidx = strHsh_[hshidx]) != HASH_FREE) {
    if (strNxt_[nxtidx] == index && strChr_[nxtidx] == b)
      return (short) nxtidx;
    hshidx = (hshidx + HASHSTEP) % HASHSIZE;
  } // ends while
  return (short) 0xFFFF;
} // ends findCharString(short, byte)
origin: jplag/jplag

public void writeHTMLHeader(HTMLFile file, String title) {
  file.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
  file.println("<HTML><HEAD><TITLE>" + title + "</TITLE>");
  file.println("<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">");
  file.println("</HEAD>");
}
origin: jplag/jplag

private final int biggestMatch() {
 int erg = 0;
 for (int i=0; i<size(); i++)
  if (matches[i].length>erg) erg=matches[i].length;
 return erg;
}
public final boolean moreThan(float percent) {
origin: jplag/jplag

public final float roundedPercentMaxAB() {
  float percent = percentMaxAB();
  return ((int)(percent * 10)) / (float)10;
}
public final float percentMaxAB() {
origin: jplag/jplag

  public int compare(AllMatches o1, AllMatches o2) {
    float p1 = o1.percentMinAB();
    float p2 = o2.percentMinAB();
    if (p1 == p2) return 0;
    if (p1 < p2)
      return -1;
    else
      return 1;
  }
}
origin: jplag/jplag

public final float percentB() {
 int divisor;
 if(bcmatchesB != null) divisor = subB.size()-subB.files.length-bcmatchesB.tokensMatched();
 else divisor = subB.size()-subB.files.length;
 return (divisor == 0 ? 0f : (tokensMatched()*100 / (float) divisor));
}
origin: jplag/jplag

public final float percentBasecodeB(){
 float sb = subB.size() - subB.files.length;
 return bcmatchesB.tokensMatched() * 100 / sb;
}
public final float roundedPercentBasecodeA() {
origin: jplag/jplag

public final float percent() {
 float sa, sb;
 if(bcmatchesB != null && bcmatchesA != null){
   sa = subA.size() - subA.files.length - bcmatchesA.tokensMatched();
   sb = subB.size() - subB.files.length - bcmatchesB.tokensMatched();
 }
 else{
   sa = subA.size() - subA.files.length;
   sb = subB.size() - subB.files.length;
 }
 return (200*(float)tokensMatched())/(sa+sb);
}
public final float percentA() {
jplag

Most used classes

  • Structure
    The tokenlist
  • ProgramI
  • Token
  • StrippedProgram
    This is a stripped version of the JPlag main class Program to be used during front end development o
  • ParserToken
  • GIFEncoder,
  • InputState,
  • Table,
  • JavaToken,
  • Parser,
  • AllBasecodeMatches,
  • AllMatches$AvgComparator,
  • AllMatches$AvgReversedComparator,
  • AllMatches$MaxComparator,
  • AllMatches$MaxReversedComparator,
  • AllMatches$MinReversedComparator,
  • AllMatches,
  • BitFile,
  • BitUtils
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now