// Path: chronos/src/main/java/com/redmadrobot/chronos/ChronosOperation.java
// public abstract class ChronosOperation<Output> {
// 
// 
//     private final AtomicBoolean mIsCancelled = new AtomicBoolean(false);
// 
//     /**
//      * The method for performing business-logic related work. Can contain time-consuming calls, but
//      * should not perform any interaction with the UI, as it will be launched not in the Main
//      * Thread.<br>
//      * <p/>
//      * All exceptions thrown in this method will be encapsulated in OperationResult object, so it
//      * will not cause app crash.
//      *
//      * @return the result of the operation.
//      */
//     @Nullable
//     public abstract Output run();
// 
//     /**
//      * This method returns a subclass of OperationResult class, related to the particular Operation
//      * subclass, so that Chronos clients can distinguish results from different operations.
//      *
//      * @return OperationResult subclass, that will be created after the operation is complete.
//      */
//     @NonNull
//     @Contract(pure = true)
//     public abstract Class<? extends ChronosOperationResult<Output>> getResultClass();
// 
//     /**
//      * Checks if the operation was cancelled.
//      *
//      * @return {@code true} if the operation was cancelled, {@code false} otherwise
//      * @see ChronosListener#cancel(int, boolean)
//      * @see ChronosListener#cancel(String, boolean)
//      * @see Chronos#cancelAll(boolean)
//      */
//     @Contract(pure = true)
//     public final boolean isCancelled() {
//         return mIsCancelled.get();
//     }
// 
//     /**
//      * Marks operation as cancelled.
//      */
//     final void cancel() {
//         mIsCancelled.set(true);
//     }
// }
// 
// Path: chronos/src/main/java/com/redmadrobot/chronos/ChronosOperationResult.java
// public abstract class ChronosOperationResult<ResultType> {
// 
//     private int mId;
// 
//     private ChronosOperation<ResultType> mOperation;
// 
//     private ResultType mOutput;
// 
//     private Exception mException;
// 
//     private boolean isBroadcast = false;
// 
//     /**
//      * @return the operations' output, is the launch was successful. If exception waw thrown during
//      * the operations' run, null will be returned. However, null may be a valid result of the
//      * operation.
//      */
//     @SuppressWarnings("unused")
//     @Contract(pure = true)
//     public final ResultType getOutput() {
//         return mOutput;
//     }
// 
//     /**
//      * @param output the result of operation.
//      * @see #getOutput()
//      */
//     final void setOutput(@Nullable final ResultType output) {
//         mOutput = output;
//     }
// 
//     /**
//      * Геттер ошибки выполнения операции.
//      *
//      * @return exception thrown during operations' launch. Returns null if there was no exception.
//      */
//     @SuppressWarnings("unused")
//     @Nullable
//     @Contract(pure = true)
//     public final Exception getException() {
//         return mException;
//     }
// 
//     /**
//      * @param exception exception thrown during the operations' launch.
//      */
//     final void setException(@NonNull final Exception exception) {
//         mException = exception;
//     }
// 
//     /**
//      * @return operation which result is stored in this object.
//      */
//     @SuppressWarnings("unused")
//     @NonNull
//     @Contract(pure = true)
//     public final ChronosOperation<ResultType> getOperation() {
//         return mOperation;
//     }
// 
//     /**
//      * @param operation operation which result is stored in this object.
//      */
//     final void setOperation(@NonNull final ChronosOperation<ResultType> operation) {
//         mOperation = operation;
//     }
// 
//     /**
//      * @return Text error description. May be null if there was no error, or it doesn't have a
//      * description.
//      */
//     @Nullable
//     @Contract(pure = true)
//     public final String getErrorMessage() {
//         return mException == null ? null : mException.getMessage();
//     }
// 
//     /**
//      * @return <b>true</b> if no exceptions was thrown during the operations' launch, <b>false</b>
//      * otherwise
//      */
//     @SuppressWarnings("unused")
//     @Contract(pure = true)
//     public final boolean isSuccessful() {
//         return mException == null;
//     }
// 
//     /**
//      * @return the unique id of operation launch.
//      * @see #setId(int)
//      */
//     @Contract(pure = true)
//     final int getId() {
//         return mId;
//     }
// 
//     /**
//      * @param id the unique id of operation launch.
//      * @see #getId()
//      */
//     final void setId(final int id) {
//         mId = id;
//     }
// 
//     /**
//      * @return <b>true</b> if the object should be broadcasted, <b>false</b> otherwise
//      */
//     @Contract(pure = true)
//     final boolean isBroadcast() {
//         return isBroadcast;
//     }
// 
//     /**
//      * @param isBroadcast if the result should be broadcasted among all clients
//      */
//     final void setBroadcast(final boolean isBroadcast) {
//         this.isBroadcast = isBroadcast;
//     }
// }


import com.redmadrobot.chronos.ChronosOperation;
import com.redmadrobot.chronos.ChronosOperationResult;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
package com.redmadrobot.chronos_sample.operations;



/**
 * An operation that calculates a string length, mocking it is being a time-consuming task.
 *
 * @author maximefimov
 */
public final class SimpleOperation extends ChronosOperation<String> {

    private final String mInput;

    public SimpleOperation(@NonNull final String input) {
// Path: chronos/src/main/java/com/redmadrobot/chronos/ChronosOperation.java
// public abstract class ChronosOperation<Output> {
// 
// 
//     private final AtomicBoolean mIsCancelled = new AtomicBoolean(false);
// 
//     /**
//      * The method for performing business-logic related work. Can contain time-consuming calls, but
//      * should not perform any interaction with the UI, as it will be launched not in the Main
//      * Thread.<br>
//      * <p/>
//      * All exceptions thrown in this method will be encapsulated in OperationResult object, so it
//      * will not cause app crash.
//      *
//      * @return the result of the operation.
//      */
//     @Nullable
//     public abstract Output run();
// 
//     /**
//      * This method returns a subclass of OperationResult class, related to the particular Operation
//      * subclass, so that Chronos clients can distinguish results from different operations.
//      *
//      * @return OperationResult subclass, that will be created after the operation is complete.
//      */
//     @NonNull
//     @Contract(pure = true)
//     public abstract Class<? extends ChronosOperationResult<Output>> getResultClass();
// 
//     /**
//      * Checks if the operation was cancelled.
//      *
//      * @return {@code true} if the operation was cancelled, {@code false} otherwise
//      * @see ChronosListener#cancel(int, boolean)
//      * @see ChronosListener#cancel(String, boolean)
//      * @see Chronos#cancelAll(boolean)
//      */
//     @Contract(pure = true)
//     public final boolean isCancelled() {
//         return mIsCancelled.get();
//     }
// 
//     /**
//      * Marks operation as cancelled.
//      */
//     final void cancel() {
//         mIsCancelled.set(true);
//     }
// }
// 
// Path: chronos/src/main/java/com/redmadrobot/chronos/ChronosOperationResult.java
// public abstract class ChronosOperationResult<ResultType> {
// 
//     private int mId;
// 
//     private ChronosOperation<ResultType> mOperation;
// 
//     private ResultType mOutput;
// 
//     private Exception mException;
// 
//     private boolean isBroadcast = false;
// 
//     /**
//      * @return the operations' output, is the launch was successful. If exception waw thrown during
//      * the operations' run, null will be returned. However, null may be a valid result of the
//      * operation.
//      */
//     @SuppressWarnings("unused")
//     @Contract(pure = true)
//     public final ResultType getOutput() {
//         return mOutput;
//     }
// 
//     /**
//      * @param output the result of operation.
//      * @see #getOutput()
//      */
//     final void setOutput(@Nullable final ResultType output) {
//         mOutput = output;
//     }
// 
//     /**
//      * Геттер ошибки выполнения операции.
//      *
//      * @return exception thrown during operations' launch. Returns null if there was no exception.
//      */
//     @SuppressWarnings("unused")
//     @Nullable
//     @Contract(pure = true)
//     public final Exception getException() {
//         return mException;
//     }
// 
//     /**
//      * @param exception exception thrown during the operations' launch.
//      */
//     final void setException(@NonNull final Exception exception) {
//         mException = exception;
//     }
// 
//     /**
//      * @return operation which result is stored in this object.
//      */
//     @SuppressWarnings("unused")
//     @NonNull
//     @Contract(pure = true)
//     public final ChronosOperation<ResultType> getOperation() {
//         return mOperation;
//     }
// 
//     /**
//      * @param operation operation which result is stored in this object.
//      */
//     final void setOperation(@NonNull final ChronosOperation<ResultType> operation) {
//         mOperation = operation;
//     }
// 
//     /**
//      * @return Text error description. May be null if there was no error, or it doesn't have a
//      * description.
//      */
//     @Nullable
//     @Contract(pure = true)
//     public final String getErrorMessage() {
//         return mException == null ? null : mException.getMessage();
//     }
// 
//     /**
//      * @return <b>true</b> if no exceptions was thrown during the operations' launch, <b>false</b>
//      * otherwise
//      */
//     @SuppressWarnings("unused")
//     @Contract(pure = true)
//     public final boolean isSuccessful() {
//         return mException == null;
//     }
// 
//     /**
//      * @return the unique id of operation launch.
//      * @see #setId(int)
//      */
//     @Contract(pure = true)
//     final int getId() {
//         return mId;
//     }
// 
//     /**
//      * @param id the unique id of operation launch.
//      * @see #getId()
//      */
//     final void setId(final int id) {
//         mId = id;
//     }
// 
//     /**
//      * @return <b>true</b> if the object should be broadcasted, <b>false</b> otherwise
//      */
//     @Contract(pure = true)
//     final boolean isBroadcast() {
//         return isBroadcast;
//     }
// 
//     /**
//      * @param isBroadcast if the result should be broadcasted among all clients
//      */
//     final void setBroadcast(final boolean isBroadcast) {
//         this.isBroadcast = isBroadcast;
//     }
// }


// Path: app/src/main/java/com/redmadrobot/chronos_sample/operations/SimpleOperation.java
import com.redmadrobot.chronos.ChronosOperation;
import com.redmadrobot.chronos.ChronosOperationResult;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

package com.redmadrobot.chronos_sample.operations;



/**
 * An operation that calculates a string length, mocking it is being a time-consuming task.
 *
 * @author maximefimov
 */
public final class SimpleOperation extends ChronosOperation<String> {

    private final String mInput;

    public SimpleOperation(@NonNull final String input) {
        mInput = input;