Hello,
I'd like to obtain this under but I don't know what I must to use. I need to access to the father of an object; I give you the idea under here:
public class MyElemNode extends MyNode {
List<MyNode> child = new ArrayList<MyNode>();
public MyElemNode() { }
public MyNode getFirstChild() { return child.get(0); }
public MyNode getLastChild() { return child.get( child.size()-1 ); }
public MyNode nextSiblingNode() { //1
int i = getPositionOfThisObjectInFather.child();
return father.child(i+1);
}
}
//main
MyElemNode e = new MyElemNode();
e. add( new MyElemNode, new MyElemNode ......................);
MyElemNode ep = e.get(5); //assuming it exists
MyElemNode sib = ep.nextSibling(); // how to obtain this?
public class MyElemNode extends MyNode {
List<MyNode> child = new ArrayList<MyNode>();
public MyElemNode() { }
public MyNode getFirstChild() { return child.get(0); }
public MyNode getLastChild() { return child.get( child.size()-1 ); }
public MyNode nextSiblingNode() { //1
int i = getPositionOfThisObjectInFather.child();
return father.child(i+1);
}
}
//main
MyElemNode e = new MyElemNode();
e. add( new MyElemNode, new MyElemNode ......................);
MyElemNode ep = e.get(5); //assuming it exists
MyElemNode sib = ep.nextSibling(); // how to obtain this?
To copy to clipboard, switch view to plain text mode
thanks
Bookmarks