[gephi-dev] Question on Graph object
Sébastien Heymann
sebastien.heymann at gephi.org
Wed Dec 15 13:58:03 CET 2010
So should we recommend to make a cast after proper testing?
Seb
2010/12/15 Martin Skurla <bujacik at gmail.com>
> I looked at the implementation classes and there is one difference,
> and that is possible ClassCastException on second command if you don't
> carefully test it to proper type.
>
> There is Hierarchical directed graph implementation which implements
> both DirectedGraph and HierarchicalGraph interfaces, so you can cast
> it without problems and nothing in memory changes.
>
> 2010/12/15 Sébastien Heymann <sebastien.heymann at gephi.org>:
> > Hi @devs,
> >
> > I have a general question on the graph object. In modules we need most of
> > the time to use specific interfaces like DirectedGraph,
> HierarchicalGraph,
> > HierarchicalDirectedGraph etc.
> > We can use them in two ways, for instance:
> >
> > DirectedGraph dg = graph.getGraphModel.getDirectedGraph();
> > dg.blah();
> >
> > or
> >
> > ((DirectedGraph) graph).blah();
> >
> >
> > Which one is the best? As I understand, calling GraphModel.getXXGraph()
> > creates a copy of the graph, which sounds not so good for memory usage...
> >
> >
> > Cheers,
> > Seb
> >
> > _______________________________________________
> > gephi-dev mailing list
> > gephi-dev at lists.gephi.org
> > http://gephi.org/mailman/listinfo/gephi-dev
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gephi.org/pipermail/gephi-dev/attachments/20101215/144af9f6/attachment.html>
More information about the gephi-dev
mailing list