code: public int getPathCount() {
      int result = 0;
      for(IndexTreePath<E> path = this; path != null; path = path.parentPath) {
        result++;
      }
      return result;
    }
docs: Returns the number of elements in the path.
  
  @return an int giving a count of items the path