Advertisement
munsking

list insert function

Sep 12th, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. this.insert = function insert(after, name){
  2.      ph=this;
  3.      while(ph.name!=after && ph.hasNext()){
  4.         ph=ph.getNext();
  5.      }
  6.      if(ph.hasNext()){
  7.          phnext=ph.getNext();
  8.      }
  9.      ph.setNext(new Column(name));
  10.      if(ph.hasNext()){
  11.          ph.getNext().setNext(phnext);
  12.      }
  13.      console.log(ph);
  14.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement