@Override public Node item(int index){
  Node thisNode;
  if (rootNode.changes() != changes) {
    nodes=new ArrayList();
    changes=rootNode.changes();
  }
  final int currentSize=nodes.size();
  if (index < currentSize) {
    return (Node)nodes.get(index);
  }
 else {
    if (currentSize == 0) {
      thisNode=rootNode;
    }
 else {
      thisNode=(NodeImpl)(nodes.get(currentSize - 1));
    }
    while (thisNode != null && index >= nodes.size()) {
      thisNode=nextMatchingElementAfter(thisNode);
      if (thisNode != null) {
        nodes.add(thisNode);
      }
    }
    return thisNode;
  }
}

@ Override public Node item ( int index ) { Node thisNode ; if ( rootNode . changes ( ) != changes ) { nodes = new ArrayList ( ) ; changes = rootNode . changes ( ) ; } final int currentSize = nodes . size ( ) ; if ( index < currentSize ) { return ( Node ) nodes . get ( index ) ; } else { if ( currentSize == 0 ) { thisNode = rootNode ; } else { thisNode = ( NodeImpl ) ( nodes . get ( currentSize - 1 ) ) ; } while ( thisNode != null && index >= nodes . size ( ) ) { thisNode = nextMatchingElementAfter ( thisNode ) ; if ( thisNode != null ) { nodes . add ( thisNode ) ; } } return thisNode ; } }
returns the node at the specified index .
