// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/GraphComputer.java
// public interface GraphComputer {
// 
//     public enum Isolation {
//         /**
//          * Computations are carried out in a bulk synchronous manner.
//          * The results of a vertex property update are only visible after the round is complete.
//          */
//         BSP,
//         /**
//          * Computations are carried out in a bulk synchronous manner.
//          * The results of a vertex property update are visible before the end of the round.
//          */
//         DIRTY_BSP
//     }
// 
//     /**
//      * Execute the GraphComputer's VertexProgram against the GraphComputer's graph.
//      * The GraphComputer must have reference to a VertexProgram and Graph.
//      * The typical flow of execution is:
//      *  1. Set up the VertexMemory as necessary given the VertexProgram (e.g. set compute keys).
//      *  2. Set up the GraphMemory as necessary given the VertexProgram.
//      *  3. Execute the VertexProgram
//      */
//     public void execute();
// 
//     /**
//      * Get the VertexSystemMemory cast as a VertexMemory to hide system specific methods.
//      *
//      * @return the GraphComputer's VertexMemory
//      */
//     public VertexMemory getVertexMemory();
// 
//     /**
//      * Get the GraphSystemMemory cast as a GraphMemory to hide system specific methods.
//      *
//      * @return the GraphComputer's GraphMemory
//      */
//     public GraphMemory getGraphMemory();
// }
// 
// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/GraphMemory.java
// public interface GraphMemory {
// 
//     public <R> R get(final String key);
// 
//     public void setIfAbsent(String key, Object value);
// 
//     public long increment(String key, long delta);
// 
//     public long decrement(String key, long delta);
// 
//     public int getIteration();
// 
//     public long getRuntime();
// 
//     public boolean isInitialIteration();
// 
//     /*public void min(String key, double value);
// 
//     public void max(String key, double value);
// 
//     public void avg(String key, double value);
// 
//     public <V> void update(String key, Function<V, V> update, V defaultValue);*/
// 
//     // public Map<String, Object> getCurrentState();
// }
// 
// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/GraphSystemMemory.java
// public interface GraphSystemMemory extends GraphMemory {
// 
//     public void incrIteration();
// 
//     public void setRuntime(final long runtime);
// }
// 
// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/VertexMemory.java
// public interface VertexMemory {
// 
//     public void setProperty(Vertex vertex, String key, Object value);
// 
//     public <T> T getProperty(Vertex vertex, String key);
// 
//     public <T> T removeProperty(Vertex vertex, String key);
// 
// }
// 
// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/VertexProgram.java
// public interface VertexProgram extends Serializable {
// 
//     public enum KeyType {
//         VARIABLE,
//         CONSTANT
//     }
// 
//     /**
//      * The method is called at the beginning of the computation.
//      * The method is global to the GraphComputer and as such, is not called for each vertex.
//      *
//      * @param graphMemory The global GraphMemory of the GraphComputer
//      */
//     public void setup(GraphMemory graphMemory);
// 
//     /**
//      * This method denotes the main body of computation.
//      *
//      * @param vertex      the vertex to execute the VertexProgram on
//      * @param graphMemory the shared state between all vertices in the computation
//      */
//     public void execute(Vertex vertex, GraphMemory graphMemory);
// 
//     /**
//      * The method is called at the end of a round to determine if the computation is complete.
//      * The method is global to the GraphComputer and as such, is not called for each vertex.
//      *
//      * @param graphMemory The global GraphMemory of the GraphComputer
//      * @return whether or not to halt the computation
//      */
//     public boolean terminate(GraphMemory graphMemory);
// 
//     public Map<String, KeyType> getComputeKeys();
// 
// 
// }
// 
// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/VertexSystemMemory.java
// public interface VertexSystemMemory extends VertexMemory {
// 
//     public boolean isComputeKey(String key);
// 
//     public void completeIteration();
// 
//     public void setComputeKeys(final Map<String, VertexProgram.KeyType> computeKeys);
// 
// }


import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.furnace.algorithms.vertexcentric.GraphComputer;
import com.tinkerpop.furnace.algorithms.vertexcentric.GraphMemory;
import com.tinkerpop.furnace.algorithms.vertexcentric.GraphSystemMemory;
import com.tinkerpop.furnace.algorithms.vertexcentric.VertexMemory;
import com.tinkerpop.furnace.algorithms.vertexcentric.VertexProgram;
import com.tinkerpop.furnace.algorithms.vertexcentric.VertexSystemMemory;
package com.tinkerpop.furnace.algorithms.vertexcentric.computers;


/**
 * AbstractGraphComputer provides the requisite fields/methods necessary for a GraphComputer.
 * This is a helper class that reduces the verbosity of a fully-written GraphComputer implementation.
 *
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
public abstract class AbstractGraphComputer implements GraphComputer {

    protected final Graph graph;
    protected VertexProgram vertexProgram;
    protected GraphSystemMemory graphMemory;
// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/GraphComputer.java
// public interface GraphComputer {
// 
//     public enum Isolation {
//         /**
//          * Computations are carried out in a bulk synchronous manner.
//          * The results of a vertex property update are only visible after the round is complete.
//          */
//         BSP,
//         /**
//          * Computations are carried out in a bulk synchronous manner.
//          * The results of a vertex property update are visible before the end of the round.
//          */
//         DIRTY_BSP
//     }
// 
//     /**
//      * Execute the GraphComputer's VertexProgram against the GraphComputer's graph.
//      * The GraphComputer must have reference to a VertexProgram and Graph.
//      * The typical flow of execution is:
//      *  1. Set up the VertexMemory as necessary given the VertexProgram (e.g. set compute keys).
//      *  2. Set up the GraphMemory as necessary given the VertexProgram.
//      *  3. Execute the VertexProgram
//      */
//     public void execute();
// 
//     /**
//      * Get the VertexSystemMemory cast as a VertexMemory to hide system specific methods.
//      *
//      * @return the GraphComputer's VertexMemory
//      */
//     public VertexMemory getVertexMemory();
// 
//     /**
//      * Get the GraphSystemMemory cast as a GraphMemory to hide system specific methods.
//      *
//      * @return the GraphComputer's GraphMemory
//      */
//     public GraphMemory getGraphMemory();
// }
// 
// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/GraphMemory.java
// public interface GraphMemory {
// 
//     public <R> R get(final String key);
// 
//     public void setIfAbsent(String key, Object value);
// 
//     public long increment(String key, long delta);
// 
//     public long decrement(String key, long delta);
// 
//     public int getIteration();
// 
//     public long getRuntime();
// 
//     public boolean isInitialIteration();
// 
//     /*public void min(String key, double value);
// 
//     public void max(String key, double value);
// 
//     public void avg(String key, double value);
// 
//     public <V> void update(String key, Function<V, V> update, V defaultValue);*/
// 
//     // public Map<String, Object> getCurrentState();
// }
// 
// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/GraphSystemMemory.java
// public interface GraphSystemMemory extends GraphMemory {
// 
//     public void incrIteration();
// 
//     public void setRuntime(final long runtime);
// }
// 
// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/VertexMemory.java
// public interface VertexMemory {
// 
//     public void setProperty(Vertex vertex, String key, Object value);
// 
//     public <T> T getProperty(Vertex vertex, String key);
// 
//     public <T> T removeProperty(Vertex vertex, String key);
// 
// }
// 
// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/VertexProgram.java
// public interface VertexProgram extends Serializable {
// 
//     public enum KeyType {
//         VARIABLE,
//         CONSTANT
//     }
// 
//     /**
//      * The method is called at the beginning of the computation.
//      * The method is global to the GraphComputer and as such, is not called for each vertex.
//      *
//      * @param graphMemory The global GraphMemory of the GraphComputer
//      */
//     public void setup(GraphMemory graphMemory);
// 
//     /**
//      * This method denotes the main body of computation.
//      *
//      * @param vertex      the vertex to execute the VertexProgram on
//      * @param graphMemory the shared state between all vertices in the computation
//      */
//     public void execute(Vertex vertex, GraphMemory graphMemory);
// 
//     /**
//      * The method is called at the end of a round to determine if the computation is complete.
//      * The method is global to the GraphComputer and as such, is not called for each vertex.
//      *
//      * @param graphMemory The global GraphMemory of the GraphComputer
//      * @return whether or not to halt the computation
//      */
//     public boolean terminate(GraphMemory graphMemory);
// 
//     public Map<String, KeyType> getComputeKeys();
// 
// 
// }
// 
// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/VertexSystemMemory.java
// public interface VertexSystemMemory extends VertexMemory {
// 
//     public boolean isComputeKey(String key);
// 
//     public void completeIteration();
// 
//     public void setComputeKeys(final Map<String, VertexProgram.KeyType> computeKeys);
// 
// }


// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/computers/AbstractGraphComputer.java
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.furnace.algorithms.vertexcentric.GraphComputer;
import com.tinkerpop.furnace.algorithms.vertexcentric.GraphMemory;
import com.tinkerpop.furnace.algorithms.vertexcentric.GraphSystemMemory;
import com.tinkerpop.furnace.algorithms.vertexcentric.VertexMemory;
import com.tinkerpop.furnace.algorithms.vertexcentric.VertexProgram;
import com.tinkerpop.furnace.algorithms.vertexcentric.VertexSystemMemory;

package com.tinkerpop.furnace.algorithms.vertexcentric.computers;


/**
 * AbstractGraphComputer provides the requisite fields/methods necessary for a GraphComputer.
 * This is a helper class that reduces the verbosity of a fully-written GraphComputer implementation.
 *
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
public abstract class AbstractGraphComputer implements GraphComputer {

    protected final Graph graph;
    protected VertexProgram vertexProgram;
    protected GraphSystemMemory graphMemory;
    protected VertexSystemMemory vertexMemory;