private int countInstances ( HeaderElement root ) { int count = 0 ; HeaderElement elem = root ; while ( null != elem ) { if ( ! elem . wasRemoved ( ) ) { count ++ ; } elem = elem . nextInstance ; } return count ; }
Count the number of instances of this header starting at the given element .