Skip to content

Adding multiple vertices with the same data #2

Open
@Carpetfizz

Description

@Carpetfizz

Hello,

Let's say I have a Vertex of the following form:

Vertex<MyClass> myVertex = new Vertex<>(myObject.getMessage());

In my program, it is possible for a Vertex with the same data to get graph.addVertex()'d. I want to be able to stop the graph from adding a Vertex if another one with the same data exists. I saw that the Vertex.hashCode is a function of some auto generated ID. If my data source is guaranteed to be unique elements, is it possible to make the hash a function of the data instead of a random ID ?

Thanks for any advice.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions