public int depth ( ) { int depth = 0 ; Path here = this ; while ( here != ROOT ) { depth ++ ; here = here . previous ; } return depth ; }
ROOT is 0 top level Entity properties are 1 embedded things are higher .