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");
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");
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();
}
}
}
Véase también
getFirstEntry method
getNextEntry method
Glosario
¿Desea opinar sobre la Ayuda?
Ayuda sobre la Ayuda
Abrir la Ayuda en pantalla completa
Glosario
¿Desea opinar sobre la Ayuda?
Ayuda sobre la Ayuda
Abrir la Ayuda en pantalla completa