Examples: ViewEntryCollection class, and Count and Parent properties

This example creates a ViewEntryCollection object for all the document entries in a view, gets the parent view and the entry count, and gets all the entries.

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);
      view.setAutoUpdate(false);
      ViewEntryCollection vec = view.getAllEntries();
      System.out.println("Parent is " + 
        vec.getParent().getName());
      System.out.println("Number of entries = " + 
        vec.getCount());
      ViewEntry tmpentry;
      ViewEntry entry = vec.getFirstEntry();
      while (entry != null) {
        System.out.println("Entry is at position " + 
        entry.getPosition('.'));
        tmpentry = vec.getNextEntry();
        entry.recycle();
        entry = tmpentry;
      }
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}