package javakurs.uebung08;

import java.util.ArrayList;
import java.util.List;

/**
 * {@link VertexPropertyMap} maps vertices to values.
 *
 * @param <ValueType>
 *          the kind of values that this map holds
 *
 * @author Bernd Kiefer, DFKI
 * @author Joerg Steffen, DFKI
 * @version $Id$
 */
public class VertexPropertyMap<ValueType> {

  /**
   * The graph to which the vertices belong.
   */
  private DirectedGraphBase<?> _graph;

  /**
   * The mapping of vertices, represented as ints, to their values
   */
  private ArrayList<ValueType> _map;


  /**
   * This creates a new instance of {@link VertexPropertyMap}.
   *
   * @param graph
   *          the graph to which the mapped vertices belong
   */
  public VertexPropertyMap(DirectedGraphBase<?> graph) {

    // TODO
  }


  /**
   * Removes all current mappings.
   */
  public void clear() {

    // TODO
  }


  /**
   * Add a mapping of the given vertex to the given value.
   *
   * @param vertex
   *          the vertex
   * @param value
   *          the mapped value
   */
  public void put(int vertex, ValueType value) {

    // TODO
  }


  /**
   * Returns the value mapped to the given vertex.
   *
   * @param vertex
   *          the vertex
   * @return the mapped value
   */
  public ValueType get(int vertex) {

    // TODO
    return null;
  }


  /**
   * Removes the mapping for the given vertex.
   *
   * @param vertex
   *          the vertex
   */
  public void remove(int vertex) {

   // TODO
  }


  /**
   * Removes the mapping for all vertices in the given vertex range.
   *
   * @param from
   *          the start vertex
   * @param to
   *          the end vertex
   */
  public void removeRange(int from, int to) {

    // TODO
  }


  /**
   * Returns all vertices whose assigned value matches the given value using the
   * given predicate.
   *
   * @param val
   *          the value to compare against
   * @param pred
   *          the predicate used to compare
   * @return a list of matching vertices
   */
  public List<Integer>
      findVertices(ValueType val, BinaryPredicate<ValueType> pred) {

    // TODO
    return null;
  }
}
