private int nodeListGetLength(){
  if (fNodeListCache == null) {
    if (needsSyncChildren()) {
      synchronizeChildren();
    }
    if (firstChild == null) {
      return 0;
    }
    if (firstChild == lastChild()) {
      return 1;
    }
    fNodeListCache=ownerDocument.getNodeListCache(this);
  }
  if (fNodeListCache.fLength == -1) {
    int l;
    ChildNode n;
    if (fNodeListCache.fChildIndex != -1 && fNodeListCache.fChild != null) {
      l=fNodeListCache.fChildIndex;
      n=fNodeListCache.fChild;
    }
 else {
      n=firstChild;
      l=0;
    }
    while (n != null) {
      l++;
      n=n.nextSibling;
    }
    fNodeListCache.fLength=l;
  }
  return fNodeListCache.fLength;
}

private int nodeListGetLength ( ) { if ( fNodeListCache == null ) { if ( needsSyncChildren ( ) ) { synchronizeChildren ( ) ; } if ( firstChild == null ) { return 0 ; } if ( firstChild == lastChild ( ) ) { return 1 ; } fNodeListCache = ownerDocument . getNodeListCache ( this ) ; } if ( fNodeListCache . fLength == - 1 ) { int l ; ChildNode n ; if ( fNodeListCache . fChildIndex != - 1 && fNodeListCache . fChild != null ) { l = fNodeListCache . fChildIndex ; n = fNodeListCache . fChild ; } else { n = firstChild ; l = 0 ; } while ( n != null ) { l ++ ; n = n . nextSibling ; } fNodeListCache . fLength = l ; } return fNodeListCache . fLength ; }
count the immediate children of this node . use to implement nodelist . getlength ( ) .
