JAVA/CORBA クラス


例:IsSorted プロパティ
次のエージェントは、文書コレクションがソートされているかどうかを判断する機能を示します。

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();
     DocumentCollection dc = db.getAllDocuments();
     printIsSorted(dc);
     dc.FTSearch("blue");
     printIsSorted(dc);
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
 void printIsSorted(DocumentCollection dc) {
   try {
     if (dc.isSorted())
       System.out.println("Is sorted");
     else
       System.out.println("Is not sorted");
   
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

関連項目