Question

I want to add a method to the Graph class of the JUNG library using Eclipse. How would I do this?

I have the JUNG working correctly as a reference library by following this answer: https://stackoverflow.com/a/5618076/1949665

Was it helpful?

Solution

1) You have access to the source: Simply add your method

2) You could extend the class and add the method in our extending class

3) Write a Util class with a static method implementing your method than simply uses the original class.

OTHER TIPS

Your comment above implies that you want to be able to find cliques in a graph. (I didn't see the original question before you edited it.)

If so, it doesn't need to be a method on Graph itself, it just needs to accept a Graph as an argument. Graph is a type like List or Map, it should not have a method for every kind of algorithm you might want to use on a graph.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top