[jgrapht-developers] Edge vertex types
Brought to you by:
barak_naveh,
perfecthash
From: Charles F. <cf...@us...> - 2005-12-14 05:46:48
|
Hi, I am getting an error when compiling the following block of code: public class NeighborIndex<V, E extends Edge<V>> implements GraphListener<V, E> { public void edgeAdded(GraphEdgeChangeEvent<V, E> e) { E edge = e.getEdge(); V source = edge.getSource(); } } The error is: incompatible types found : java.lang.Object required: V V source = edge.getSource(); ^ My understanding of generics suggests that the compiler should have already known that E extends Edge<V>, and should thus have expected V instead of Object in the above block of code. Obviously I was wrong. Any suggestions as to what I am missing, and how I can fix this? thanks, Charles -- Half a pound For Half a buck Come on shavers You're in luck Burma-Shave http://burma-shave.org/jingles/1931/half_a_pound |