<Knoten>
parent
b91dd9f0fd
commit
c9de4120b1
|
|
@ -22,21 +22,19 @@ public class Knoten {
|
||||||
public int auslesenAnPos(int pos) throws Exception {
|
public int auslesenAnPos(int pos) throws Exception {
|
||||||
|
|
||||||
int r = 0;
|
int r = 0;
|
||||||
|
// sind wir bereits an der Pos angekommen?
|
||||||
if(pos >0 && nachfolger !=null) {
|
if(pos >0 && nachfolger !=null) {
|
||||||
pos--;
|
pos--;
|
||||||
nachfolger.auslesenAnPos(pos);
|
nachfolger.auslesenAnPos(pos);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
r= this.wert;
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
if(nachfolger==null && pos>1) {
|
if(nachfolger==null && pos>1) {
|
||||||
|
|
||||||
throw new IndexOutOfBoundsException("Illegal Statement");
|
throw new IndexOutOfBoundsException("Illegal Statement");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
r= this.wert;
|
||||||
return r;
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue