Hi,
I have some problems with my java code. I Have 2 class SelGraphNode and
SelGraph. Both have constructors. The problems is when i instantiate
Node in SeleGraph,I get an error saying:
Can't find symbol
Symbol: Constructor SelGraphNode
Find Below the code for the 2 constructors:
for SelGraph:
public class SelGraph {
SelGraphNode nodes = new SelGraphNode();
//SelGrapNode node1 = new SelGrapNode();
ArrayList<SelGraphEdge> edgesList = new ArrayList<SelGraphEdge>();
ArrayList<SelGraphNode> nodesList = new ArrayList<SelGraphNode>();
//Vector edges = new Vector();
Vector table_list = new Vector();
Vector condition_list = new Vector();
Vector join_list = new Vector();
/** Creates a new instance of SelGraph */
public SelGraph(SelGraphNode N,SelGraphEdge E) {
nodes = N;
}
complete code for SelGraphNode() :
public class SelGraphNode {
public String table_name = new String();
public Vector condition = new Vector();
public boolean node_flag;
public String primary_key = new String();
/** Creates a new instance of SelGrapNode */
public SelGraphNode(String table_name, Vector condition, boolean
node_flag, String primary_key) {
this.table_name = table_name;
this.condition = condition;
this.node_flag = node_flag;
this.primary_key = primary_key;
}
public String getTableName () { return table_name; }
public Vector getCondition () { return condition; }
public boolean getNodeFlag () { return node_flag;}
public String getPrimaryKey () { return primary_key; }
}
Your help will be appreciated
Roedy Green - 04 Nov 2005 15:10 GMT
>Can't find symbol
>Symbol: Constructor SelGraphNode
>Find Below the code for the 2 constructors:
What is the code that got the error message?

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
tolu45 - 04 Nov 2005 15:30 GMT
the selection graph code. Besides when i tried to instantiate the
selGraph class, I got the same message. This was how i instantiated
it:SelGraph selGraph1 = new SelGraph(new SelGraphNode("movie", "",
true, "id"));
chris_k - 04 Nov 2005 15:34 GMT
Hi,
You are missing to explicitly provide the default no-args constructor
of class SelGraphNode
HTH,
chris
tolu45 - 04 Nov 2005 16:01 GMT
I have added that still it doesn't work
Joan - 04 Nov 2005 17:26 GMT
> Hi,
>
> You are missing to explicitly provide the default no-args
> constructor
> of class SelGraphNode
not required
> HTH,
> chris
zero - 04 Nov 2005 15:46 GMT
> Hi,
>
[quoted text clipped - 10 lines]
>
> SelGraphNode nodes = new SelGraphNode();
This is your problem. You're calling a constructor without arguments,
but...
> //SelGrapNode node1 = new SelGrapNode();
> ArrayList<SelGraphEdge> edgesList = new ArrayList<SelGraphEdge>();
[quoted text clipped - 26 lines]
> this.primary_key = primary_key;
> }
...SelGraphNode only has a constructor with 4 arguments. Add a
no-argument constructor. Or just remove the new SelGraphNode() part, as
variable nodes is instantiated in the constructor anyway.
Also, you're mixing typed collections (ArrayList<SelGraphEdge>
edgesList) with raw collections(Vector table_list). What's the
reasoning behind that?