package innovimax.mixthem.operation;

import java.util.EnumSet;
import java.util.stream.IntStream;

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

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

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

    /**
    * Has a result ?
    */
    boolean hasResult() {
        return this.types.contains(ResultType.HAS_RESULT);     
    }

}

@@ -35,34 +35,8 @@
 n;%0A%0A
-import java.util.EnumSet;%0A
 impo
@@ -66,16 +66,16 @@
 Stream;%0A
+
 %0A/**%0A* %3C
@@ -208,53 +208,8 @@
    %0A
-    private final EnumSet%3CResultType%3E types;%0A
     
@@ -321,63 +321,8 @@
 ) %7B%0A
-        this.types = EnumSet.noneOf(ResultType.class);%0A
     
@@ -430,36 +430,8 @@
    %0A
-        this.types.clear();%0A
     
@@ -594,99 +594,8 @@
 lt;%0A
-        if (result != null) %7B%0A            this.types.add(ResultType.HAS_RESULT);%0A        %7D%0A
     
@@ -800,51 +800,23 @@
 his.
-types.contains(ResultType.HAS_RESULT);     
+result != null;
 %0A   

Update ByteResult.java