// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
return nodes.get( 0 );
}
+ /**
+ * This is time-inefficient since it runs a iterator each time it is called.
+ *
+ */
+ public int getNodeCount() {
+ if ( isEmpty() ) {
+ return 0;
+ }
+ int c = 0;
+ for( final PhylogenyNodeIterator it = iteratorPreorder(); it.hasNext(); it.next() ) {
+ ++c;
+ }
+ return c;
+ }
+
public int getNumberOfBranches() {
if ( isEmpty() ) {
return 0;