Skip to content

Commit

Permalink
First Relevant Implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
LTimothy committed Oct 30, 2019
1 parent 28cd996 commit d8d90e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DoubleEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ private void runQualtricsDEVL() {
saveOption = 1;
}
s = new QualtricsSurvey(file, new Delimiter("[\\t]", "\t", "\n"), indexColumn, doublePrefix);
logic = new QualtricsDEVL(s, saveOption);
logic = new QualtricsDEVL(s, saveOption, relevantColumn);
} catch (Exception e) {
appendStatus("\nFailed to run QualtricsDEVL.\n");
System.out.println("runQualtricsDEVL(): " + e);
Expand Down
6 changes: 4 additions & 2 deletions QualtricsDEVL.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ public class QualtricsDEVL extends DoubleEntryValidationLogic {
private int idKey;
private int numSaved;
private int saveOption;
private int firstRelevant;
private Delimiter delim;
private Survey s;

public QualtricsDEVL(Survey s, int saveOption) {
public QualtricsDEVL(Survey s, int saveOption, int firstRelevant) {
this.s = s;
this.saveOption = saveOption;
this.delim = this.s.getDelimiter();
this.numSaved = 0;
this.firstRelevant = firstRelevant;
this.results = new StringBuilder();
this.idKey = this.s.getIndex();
if (this.idKey > this.s.getHeaderColumnLength()) {
Expand Down Expand Up @@ -98,7 +100,7 @@ private void printOffending(String originalEntry, String doubleEntry) {
String secondValue = second.columnData(i);
boolean foundMismatch = false;

if (i != this.idKey && i < maxReach) {
if (i != this.idKey && i < maxReach && i >= this.firstRelevant) {
if (!firstValue.equals(secondValue)) {
foundMismatch = true;
if (savedSomething == false) {
Expand Down

0 comments on commit d8d90e7

Please sign in to comment.