public int depth(){
  if (elementStack == null) {
    return 0;
  }
  return elementStack.size();
}

public int depth ( ) { if ( elementStack == null ) { return 0 ; } return elementStack . size ( ) ; }
fetches the current depth of element tree .
