home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / Notes.jar / lotus / notes / DocumentCollection.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-15  |  3.7 KB  |  259 lines

  1. package lotus.notes;
  2.  
  3. public class DocumentCollection extends NotesBase {
  4.    private transient Database database;
  5.  
  6.    private native int NgetFirstDocument();
  7.  
  8.    private native int NgetLastDocument();
  9.  
  10.    private native int NgetNextDocument(Document var1);
  11.  
  12.    private native int NgetPrevDocument(Document var1);
  13.  
  14.    private native int NgetNthDocument(int var1);
  15.  
  16.    private native void NFTSearch(String var1, int var2);
  17.  
  18.    private native void NremoveAll(boolean var1);
  19.  
  20.    private native void NupdateAll();
  21.  
  22.    private native void NstampAll(String var1, Object var2);
  23.  
  24.    private native void NputAllInFolder(String var1);
  25.  
  26.    private native void NremoveAllFromFolder(String var1);
  27.  
  28.    protected DocumentCollection() throws NotesException {
  29.    }
  30.  
  31.    protected DocumentCollection(Database var1, int var2) throws NotesException {
  32.       super(var2, 11);
  33.       if (var1 == null) {
  34.          throw new NotesException(JavaString.resource.getString("missing_db_object"));
  35.       } else {
  36.          this.database = var1;
  37.          var1.AddObject(this);
  38.       }
  39.    }
  40.  
  41.    protected void InternalFinalize() throws NotesException {
  42.       super.finalize();
  43.    }
  44.  
  45.    public void finalize() throws NotesException {
  46.       this.database.RemoveObject(this);
  47.       this.InternalFinalize();
  48.    }
  49.  
  50.    public void recycle() throws NotesException {
  51.       try {
  52.          this.database.RemoveObject(this);
  53.       } catch (NotesException var5) {
  54.       } finally {
  55.          super.Recycle();
  56.       }
  57.  
  58.    }
  59.  
  60.    public int GetCppObj() {
  61.       return super.GetCppObj();
  62.    }
  63.  
  64.    public Document getFirstDocument() throws NotesException {
  65.       ((NotesBase)this).CheckObject();
  66.       synchronized(this){}
  67.  
  68.       Document var1;
  69.       try {
  70.          var1 = this.database.FindOrCreateDocument(this.NgetFirstDocument());
  71.       } catch (Throwable var5) {
  72.          throw var5;
  73.       }
  74.  
  75.       return var1;
  76.    }
  77.  
  78.    public Document getLastDocument() throws NotesException {
  79.       ((NotesBase)this).CheckObject();
  80.       synchronized(this){}
  81.  
  82.       Document var1;
  83.       try {
  84.          var1 = this.database.FindOrCreateDocument(this.NgetLastDocument());
  85.       } catch (Throwable var5) {
  86.          throw var5;
  87.       }
  88.  
  89.       return var1;
  90.    }
  91.  
  92.    public Document getNextDocument(Document var1) throws NotesException {
  93.       ((NotesBase)this).CheckObject();
  94.       synchronized(this){}
  95.  
  96.       Document var2;
  97.       try {
  98.          var2 = this.database.FindOrCreateDocument(this.NgetNextDocument(var1));
  99.       } catch (Throwable var6) {
  100.          throw var6;
  101.       }
  102.  
  103.       return var2;
  104.    }
  105.  
  106.    public Document getPrevDocument(Document var1) throws NotesException {
  107.       ((NotesBase)this).CheckObject();
  108.       synchronized(this){}
  109.  
  110.       Document var2;
  111.       try {
  112.          var2 = this.database.FindOrCreateDocument(this.NgetPrevDocument(var1));
  113.       } catch (Throwable var6) {
  114.          throw var6;
  115.       }
  116.  
  117.       return var2;
  118.    }
  119.  
  120.    public Document getNthDocument(int var1) throws NotesException {
  121.       ((NotesBase)this).CheckObject();
  122.       synchronized(this){}
  123.  
  124.       Document var2;
  125.       try {
  126.          var2 = this.database.FindOrCreateDocument(this.NgetNthDocument(var1));
  127.       } catch (Throwable var6) {
  128.          throw var6;
  129.       }
  130.  
  131.       return var2;
  132.    }
  133.  
  134.    public void FTSearch(String var1, int var2) throws NotesException {
  135.       ((NotesBase)this).CheckObject();
  136.       synchronized(this){}
  137.  
  138.       try {
  139.          this.NFTSearch(var1, var2);
  140.       } catch (Throwable var5) {
  141.          throw var5;
  142.       }
  143.  
  144.    }
  145.  
  146.    public void removeAll(boolean var1) throws NotesException {
  147.       ((NotesBase)this).CheckObject();
  148.       synchronized(this){}
  149.  
  150.       try {
  151.          Document var5;
  152.          for(Document var4 = this.getFirstDocument(); var4 != null; var4 = var5) {
  153.             var5 = this.getNextDocument(var4);
  154.             var4.finalize();
  155.          }
  156.  
  157.          this.NremoveAll(var1);
  158.       } catch (Throwable var7) {
  159.          throw var7;
  160.       }
  161.  
  162.    }
  163.  
  164.    public void updateAll() throws NotesException {
  165.       ((NotesBase)this).CheckObject();
  166.       synchronized(this){}
  167.  
  168.       try {
  169.          this.NupdateAll();
  170.       } catch (Throwable var3) {
  171.          throw var3;
  172.       }
  173.  
  174.    }
  175.  
  176.    public void stampAll(String var1, Object var2) throws NotesException {
  177.       ((NotesBase)this).CheckObject();
  178.       synchronized(this){}
  179.  
  180.       try {
  181.          this.NstampAll(var1, var2);
  182.       } catch (Throwable var5) {
  183.          throw var5;
  184.       }
  185.  
  186.    }
  187.  
  188.    public void putAllInFolder(String var1) throws NotesException {
  189.       ((NotesBase)this).CheckObject();
  190.       synchronized(this){}
  191.  
  192.       try {
  193.          this.NputAllInFolder(var1);
  194.       } catch (Throwable var4) {
  195.          throw var4;
  196.       }
  197.  
  198.    }
  199.  
  200.    public void removeAllFromFolder(String var1) throws NotesException {
  201.       ((NotesBase)this).CheckObject();
  202.       synchronized(this){}
  203.  
  204.       try {
  205.          this.NremoveAllFromFolder(var1);
  206.       } catch (Throwable var4) {
  207.          throw var4;
  208.       }
  209.  
  210.    }
  211.  
  212.    public int getCount() throws NotesException {
  213.       ((NotesBase)this).CheckObject();
  214.       synchronized(this){}
  215.  
  216.       int var1;
  217.       try {
  218.          var1 = ((NotesBase)this).PropGetInt(1330);
  219.       } catch (Throwable var5) {
  220.          throw var5;
  221.       }
  222.  
  223.       return var1;
  224.    }
  225.  
  226.    public boolean isSorted() throws NotesException {
  227.       ((NotesBase)this).CheckObject();
  228.       synchronized(this){}
  229.  
  230.       boolean var1;
  231.       try {
  232.          var1 = ((NotesBase)this).PropGetBool(1331);
  233.       } catch (Throwable var5) {
  234.          throw var5;
  235.       }
  236.  
  237.       return var1;
  238.    }
  239.  
  240.    public String getQuery() throws NotesException {
  241.       ((NotesBase)this).CheckObject();
  242.       synchronized(this){}
  243.  
  244.       String var1;
  245.       try {
  246.          var1 = ((NotesBase)this).PropGetString(1332);
  247.       } catch (Throwable var5) {
  248.          throw var5;
  249.       }
  250.  
  251.       return var1;
  252.    }
  253.  
  254.    public Database getParent() throws NotesException {
  255.       ((NotesBase)this).CheckObject();
  256.       return this.database;
  257.    }
  258. }
  259.