org.jgrapht.ext

## Class IntegerNameProvider<V>

- java.lang.Object
- - org.jgrapht.ext.IntegerNameProvider<V>

- All Implemented Interfaces:
    VertexNameProvider<V>

      public class IntegerNameProvider<V>
      extends Object
      implements VertexNameProvider<V>

  Assigns a unique integer to represent each vertex. Each instance of IntegerNameProvider maintains an internal map between every vertex it has ever seen and the unique integer representing that vertex. As a result it is probably desirable to have a separate instance for each distinct graph.
  Author:
    Charles Fry

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IntegerNameProvider()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clears all cached identifiers, and resets the unique identifier counter.
    `String` | `getVertexName(V vertex)` Returns the String representation of the unique integer representing a vertex.

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

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

- - ### Constructor Detail

    - #### IntegerNameProvider

          public IntegerNameProvider()

  - ### Method Detail

    - #### clear

          public void clear()

      Clears all cached identifiers, and resets the unique identifier counter.

    - #### getVertexName

          public String getVertexName(V vertex)

      Returns the String representation of the unique integer representing a vertex.
      Specified by:
        `getVertexName` in interface `VertexNameProvider<V>`
      Parameters:
        `vertex` - the vertex to be named
      Returns:
        the name of
      See Also:
        `GraphListener.edgeAdded(GraphEdgeChangeEvent)`

Copyright © 2016. All rights reserved.