When trying to extend DirectedSparseEdge I get the following error:
jungtest.java:6: cannot resolve symbol
symbol : constructor DirectedSparseEdge ()
location: class edu.uci.ics.jung.graph.impl.DirectedSparseEdge
public jungtest(DirectedSparseVertex from, DirectedSparseVertex to) {
^
The file is simply contains:
import edu.uci.ics.jung.graph.impl.DirectedSparseEdge;
import edu.uci.ics.jung.graph.impl.DirectedSparseVertex;
public class jungtest extends DirectedSparseEdge {
public jungtest(DirectedSparseVertex from, DirectedSparseVertex to) {
}
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-11-16
Sorry about the text formatting. The Carot marking the error is under the first curly bracket in the constructor
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When trying to extend DirectedSparseEdge I get the following error:
jungtest.java:6: cannot resolve symbol
symbol : constructor DirectedSparseEdge ()
location: class edu.uci.ics.jung.graph.impl.DirectedSparseEdge
public jungtest(DirectedSparseVertex from, DirectedSparseVertex to) {
^
The file is simply contains:
import edu.uci.ics.jung.graph.impl.DirectedSparseEdge;
import edu.uci.ics.jung.graph.impl.DirectedSparseVertex;
public class jungtest extends DirectedSparseEdge {
public jungtest(DirectedSparseVertex from, DirectedSparseVertex to) {
}
}
Sorry about the text formatting. The Carot marking the error is under the first curly bracket in the constructor
Joshua,
By default, in Java, a constructor starts off by calling the constructor of its superclass. Thus, your function is essentially
public jungtest ( ... ) {
super();
}
As the system is pointing out, that's not the appropriate constructor for the superclass. Try, instead,
public jungtest(DirectedSparseVertex from, DirectedSparseVertex to) {
super( from, to );
}
For a good example, look at the source code for BipartiteGraph, which extends UndirectedSparseGraph.