JAVA/CORBA CLASSES
Examples: getFirstEntry and getNextEntry methods
1. This example gets all the entries in a view entry collection first to last.
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);
ViewEntryCollection vec = view.getAllEntries();
ViewEntry entry = vec.getFirstEntry();
while (entry != null) {
System.out.println("Entry is at position " +
entry.getPosition('.'));
entry = vec.getNextEntry(); }
} catch(Exception e) {
e.printStackTrace();
}
}
}
2. This example gets the second and next to last entries in a view entry collection.
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);
ViewEntryCollection vec = view.getAllEntries();
ViewEntry entryFirst = vec.getFirstEntry();
ViewEntry entryLast = vec.getLastEntry();
System.out.println("Second entry is at position " +
vec.getNextEntry(entryFirst).getPosition('.'));
System.out.println("Next to last entry is at
position " +
vec.getPrevEntry(entryLast).getPosition('.'));
} catch(Exception e) {
e.printStackTrace();
}
}
}
See Also
getFirstEntry method
getNextEntry method
Glossary
Feedback on
Help
or
Product Usability
?
Help on Help
All Help Contents
Glossary