package innovimax.mixthem.operation;

import java.util.EnumSet;

/**
* <p>Describes the result of an line operation on two files.</p>
* @author Innovimax
* @version 1.0
*/
public class LineResult {
    
    private final EnumSet<ResultType> types;
    private String result;
    private String line1;
    private String line2;    
    
    /**
    * Creates a line result.    
    */
    public LineResult() {
        this.types = EnumSet.noneOf(ResultType.class);
        this.result = null;
        this.line1 = null;
        this.line2 = null;        
    }

    /**
    * Reset the result.
    */
    void reset() {        
        this.types.clear();
        this.result = null;
    }
    
    /**
    * Set the result (maybe null).
    */
    void setResult(String result) {
        this.result = result;
        if (result != null) {
            this.types.add(ResultType.HAS_RESULT);
        }
    }

    /**
    * Returns the result (maybe null).
    */
    String getResult() {
        return this.result;
    }

    /**
    * Has a result ?
    */
    boolean hasResult() {
        return this.types.contains(ResultType.HAS_RESULT);     
    }
    
    /**
    * Get the first line.
    */
    String getFirstLine() {
        return this.line1;
    }
    
    /**
    * Get the second line.
    */
    String getSecondLine() {
        return this.line2;
    }
    
    /**
    * Preserves first file from reading
    */
    void preserveFirstLine(String line) {        
        this.types.add(ResultType.PRESERVE_FIRST_LINE);
        this.line1 = line;
    }

    /**
    * Has to read first file ?
    */
    boolean readingFirstFile() {
        return !this.types.contains(ResultType.PRESERVE_FIRST_LINE);
    }

    /**
    * Preserves second file from reading
    */
    void preserveSecondLine(String line) {
        this.types.add(ResultType.PRESERVE_SECOND_LINE);
        this.line2 = line;
    }

    /**
    * Has to read second file ?
    */
    boolean readingSecondFile() {
        return !this.types.contains(ResultType.PRESERVE_SECOND_LINE);
    }

}

@@ -1278,97 +1278,336 @@
   * 
-Get the second line.%0A    */%0A    String getSecondLine() %7B%0A        return this.line2;%0A    %7D
+Set the first line.%0A    */%0A    void setFirstLine(String line) %7B%0A        this.line1 = line;%0A    %7D%0A    %0A    /**%0A    * Get the second line.%0A    */%0A    String getSecondLine() %7B%0A        return this.line2;%0A    %7D%0A    %0A    /**%0A    * Set the second line.%0A    */%0A    void setSecondLine(String line) %7B%0A        this.line2 = line;%0A    %7D%0A    
 %0A   
@@ -1690,27 +1690,16 @@
 rstLine(
-String line
 ) %7B     
@@ -1762,35 +1762,8 @@
 E);%0A
-        this.line1 = line;%0A
     
@@ -2000,35 +2000,24 @@
 eSecondLine(
-String line
 ) %7B%0A        
@@ -2064,25 +2064,24 @@
 D_LINE);
-%0A
         
 this.lin
@@ -2072,34 +2072,16 @@
         
-this.line2 = line;
 %0A    %7D%0A%0A

Update LineResult.java