Changeset 6506


Ignore:
Timestamp:
2004-01-15T11:32:36+13:00 (20 years ago)
Author:
cs025
Message:

Write out the NumLeafDocs in AbstractHierarchy.

Location:
trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/classifier
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/classifier/AZListClassifier.java

    r6496 r6506  
    167167
    168168  public void completeClassification()
    169   {
    170     this.writeSQL(this.database);
     169  { this.writeSQL(this.database);
    171170  }
    172171
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/classifier/AbstractHierarchyNode.java

    r6496 r6506  
    174174  }
    175175
     176  public int noOfChildDocs()
     177  { return this.childDocs.size();
     178  }
     179
     180  public int noOfLeafDocs()
     181  { int total = this.childDocs.size();
     182
     183    Iterator iterator = this.childNodes.iterator();
     184    while (iterator.hasNext()) {
     185      AbstractHierarchyNode childNode = (AbstractHierarchyNode) iterator.next();
     186
     187      total += childNode.noOfLeafDocs();
     188    }
     189
     190    return total;
     191  }
     192
    176193  /**
    177194   *  Set the name for this hierarchy node - i.e. its brief description
     
    279296      action.addValue("Name", this.name);
    280297      action.addValue("Description", this.descriptor);
     298      action.addValue("NumLeafDocs", Integer.toString(this.noOfLeafDocs()), GS3SQLField.INTEGER_TYPE);
    281299
    282300      connection.execute(action.toString());
Note: See TracChangeset for help on using the changeset viewer.