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 = EnumSet.noneOf(ResultType.class);
    private String result = null;

    /**
    * Reset the result types.
    */
    void resetTypes() {        
        this.types.clear(); 
    }
    
    /**
    * Set the result of the operation (maybe null).
    */
    void setResult(String result) {
        this.result = result;        
        this.types.add(result == null ? ResultType._IGNORE_RESULT : ResultType._GET_RESULT);        
    }

    /**
    * Ignores the result of the operation (set to null).
    */
    void ignoreResult() {
        this.types.add(ResultType._IGNORE_RESULT);
    }

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

    /**
    * Preserves first file from reading
    */
    void preserveFirst() {
        this.types.add(ResultType._READ_LAST);        
    }

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

    /**
    * Preserves last file from reading
    */
    void preserveLast() {
        this.types.add(ResultType._READ_FIRST);        
    }

    /**
    * Has to read last file ?
    */
    boolean readLast() {
        return this.types.contains(ResultType._READ_LAST);        
    }

    /**
    * Explores both files for next reading
    */
    void exploreBoth() {
        this.types.add(ResultType._READ_BOTH);        
    }   

    /**
    * Has to read both files ?
    */
    boolean readBoth() {
        return this.types.contains(ResultType._READ_BOTH);        
    } 

}

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 = EnumSet.noneOf(ResultType.class);
    private String line1 = null;
    private String line2 = null;
    private String result = null;

    /**
    * Reset the result types.
    */
    void resetTypes() {        
        this.types.clear(); 
    }
    
    /**
    * Reset the read lines.
    */
    void resetLines() {        
        this.line1 = null;
        this.line2 = null;
    }

    /**
    * Set the first line.
    */
    void setFirstLine(String line) {
        this.line1 = line;        
    }
    
    /**
    * Get the first line.
    */
    String getFirstLine() {
        return this.line1;
    }
    
    /**
    * Set the last line.
    */
    void setLastLine(String line) {
        this.line2 = line;        
    }
    
    /**
    * Get the last line.
    */
    String getLastLine() {
        return this.line2;
    }
    
    /**
    * Set the result of the operation (maybe null).
    */
    void setResult(String result) {
        this.result = result;        
        this.types.add(result == null ? ResultType._IGNORE_RESULT : ResultType._GET_RESULT);        
    }

    /**
    * Ignores the result of the operation (set to null).
    */
    void ignoreResult() {
        this.types.add(ResultType._IGNORE_RESULT);
    }

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

    /**
    * Preserves first file from reading
    */
    void preserveFirst() {
        this.types.add(ResultType._READ_LAST);        
    }

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

    /**
    * Preserves last file from reading
    */
    void preserveLast() {
        this.types.add(ResultType._READ_FIRST);        
    }

    /**
    * Has to read last file ?
    */
    boolean readLast() {
        return this.types.contains(ResultType._READ_LAST);        
    }

    /**
    * Explores both files for next reading
    */
    void exploreBoth() {
        this.types.add(ResultType._READ_BOTH);        
    }   

    /**
    * Has to read both files ?
    */
    boolean readBoth() {
        return this.types.contains(ResultType._READ_BOTH);        
    } 

}

Update LineResult.java