Re: [jgrapht-users] DefaultEdge vs Void
Brought to you by:
barak_naveh,
perfecthash
From: Victor P. <po...@na...> - 2018-01-06 18:52:09
|
But what if I write the following? class MyVoid { // empty } Graph<T,MyVoid> Will this instantiation "work"? I ask because it seems to me to store source and target in each edge is redundant, because in context of its usage the source and target is known. I ask therefore, if we can use an empty class like MyVoid to avoid storing source and destination. On Sat, 2018-01-06 at 19:56 +0200, Dimitrios Michail wrote: > Not really. Void is just a placeholder type which cannot be > instantiated. The type you provide for the edgesmust be a class that > can be instantiated. > > Read about Java Generics in order to understand its purpose (https:// > docs.oracle.com/javase/tutorial/java/generics/index.html). > > There are plenty of examples of graph instantiations in the JGraphT > test cases. > > --Dimitrios > > > > On Sat, Jan 6, 2018 at 4:14 PM, Victor Porton <po...@na...> > wrote: > > What is the difference between Graph<T,DefaultEdge> and > > Graph<T,Void>? > > > > > > > > Does the second work? > > > > > > > > ----------------------------------------------------------------- > > ------------- > > > > Check out the vibrant tech community on one of the world's most > > > > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > > _______________________________________________ > > > > jgrapht-users mailing list > > > > jgr...@li... > > > > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > > > > ------------------------------------------------------------------- > ----------- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot__________ > _____________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users |