com.mxgraph.analysis

## Class mxDistanceCostFunction

- java.lang.Object
- - com.mxgraph.analysis.mxDistanceCostFunction

- All Implemented Interfaces:
    mxICostFunction

      public class mxDistanceCostFunction
      extends java.lang.Object
      implements mxICostFunction

  Implements a cost function for the Euclidean length of an edge.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `mxDistanceCostFunction()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getCost(mxCellState state)` Returns the Euclidean length of the edge defined by the absolute points in the given state or 0 if no points are defined.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### mxDistanceCostFunction

          public mxDistanceCostFunction()

  - ### Method Detail

    - #### getCost

          public double getCost(mxCellState state)

      Returns the Euclidean length of the edge defined by the absolute points in the given state or 0 if no points are defined.
      Specified by:
        `getCost` in interface `mxICostFunction`
      Parameters:
        `state` - The cell state to be evaluated
      Returns:
        Returns the cost to traverse the given cell state.

Copyright (c) 2010 Gaudenz Alder. All rights reserved.