例: getPrevSibling method (ViewNavigator - Java™)

次のエージェントは、すべての最上位エントリを最後から最初の順に取得します。

import lotus.domino.*;
public class JavaAgent extends AgentBase {
  public void NotesMain() {
    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();
      // (Your code goes here) 
      Database db = agentContext.getCurrentDatabase();
      View view = db.getView("By Category");
      view.setAutoUpdate(false);
      ViewNavigator nav = view.createViewNav();
      ViewEntry tmpentry;
      ViewEntry entry = nav.getLast();
      int n = 0;
      do { entry = nav.getCurrent(); }
        while (nav.gotoParent());
      while (entry != null) {
        System.out.println("Last category minus " + n + " 
        has " +
        entry.getDescendantCount() + " descendants");
        n++;
        tmpentry = nav.getPrevSibling(); 
        entry.recycle();
        entry = tmpentry;
      }
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}