V - the graph vertex typepublic class VertexToIntegerMapping<V>
extends java.lang.Object
This class computes the mapping only once, on instantiation. It does not support live updates.
| Constructor and Description |
|---|
VertexToIntegerMapping(java.util.Collection<V> vertices)
Create a new mapping from a collection of vertices.
|
VertexToIntegerMapping(java.util.List<V> vertices)
Create a new mapping from a list of vertices.
|
VertexToIntegerMapping(java.util.Set<V> vertices)
Create a new mapping from a set of vertices.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<V> |
getIndexList()
Get the
indexList, a mapping from integers to vertices (i.e. |
java.util.Map<V,java.lang.Integer> |
getVertexMap()
Get the
vertexMap, a mapping from vertices to integers (i.e. |
public VertexToIntegerMapping(java.util.Set<V> vertices)
vertices - the input set of verticesjava.lang.NullPointerException - if vertices is nullpublic VertexToIntegerMapping(java.util.List<V> vertices)
indexList so it must not be modified.vertices - the input list of verticesjava.lang.NullPointerException - if vertices is nulljava.lang.IllegalArgumentException - if the vertices are not distinctpublic VertexToIntegerMapping(java.util.Collection<V> vertices)
vertices - the input collection of verticesjava.lang.NullPointerException - if vertices is nulljava.lang.IllegalArgumentException - if the vertices are not distinctpublic java.util.Map<V,java.lang.Integer> getVertexMap()
vertexMap, a mapping from vertices to integers (i.e. the inverse of
indexList).public java.util.List<V> getIndexList()
indexList, a mapping from integers to vertices (i.e. the inverse of
vertexMap).Copyright © 2019. All Rights Reserved.