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

  1. package lotus.notes;
  2.  
  3. import java.util.Enumeration;
  4. import java.util.Vector;
  5.  
  6. public class View extends NotesBase {
  7.    private transient Database database;
  8.    private transient Vector columns;
  9.  
  10.    private native void Nclear();
  11.  
  12.    private native int NFTSearch(String var1, int var2);
  13.  
  14.    private native int NgetChild(Document var1);
  15.  
  16.    private native int NgetDocumentByKey(Vector var1, boolean var2);
  17.  
  18.    private native int NgetAllDocumentsByKey(Vector var1, boolean var2);
  19.  
  20.    private native int NgetFirstDocument();
  21.  
  22.    private native int NgetLastDocument();
  23.  
  24.    private native int NgetNextDocument(Document var1);
  25.  
  26.    private native int NgetNextSibling(Document var1);
  27.  
  28.    private native int NgetNthDocument(int var1);
  29.  
  30.    private native int NgetParentDocument(Document var1);
  31.  
  32.    private native int NgetPrevDocument(Document var1);
  33.  
  34.    private native int NgetPrevSibling(Document var1);
  35.  
  36.    private native void Nrefresh();
  37.  
  38.    private native void Nremove();
  39.  
  40.    protected View() throws NotesException {
  41.    }
  42.  
  43.    protected View(Database var1, int var2) throws NotesException {
  44.       super(var2, 3);
  45.       if (var1 == null) {
  46.          throw new NotesException(JavaString.resource.getString("missing_db_object"));
  47.       } else {
  48.          this.database = var1;
  49.          this.columns = new Vector(3);
  50.          var1.AddView(this);
  51.       }
  52.    }
  53.  
  54.    protected void InternalFinalize() throws NotesException {
  55.       try {
  56.          Enumeration var3 = this.columns.elements();
  57.  
  58.          while(var3.hasMoreElements()) {
  59.             ViewColumn var4 = (ViewColumn)var3.nextElement();
  60.             super.DestroyObject(var4);
  61.          }
  62.       } catch (Exception var7) {
  63.       } finally {
  64.          this.columns.removeAllElements();
  65.          super.finalize();
  66.       }
  67.  
  68.    }
  69.  
  70.    public void finalize() throws NotesException {
  71.       this.database.RemoveView(this);
  72.       this.InternalFinalize();
  73.    }
  74.  
  75.    protected void AddColumn(ViewColumn var1) throws NotesException {
  76.       ((NotesBase)this).CheckObject();
  77.       Vector var2 = this.columns;
  78.       synchronized(var2){}
  79.  
  80.       try {
  81.          this.columns.addElement(var1);
  82.       } catch (Throwable var4) {
  83.          throw var4;
  84.       }
  85.  
  86.    }
  87.  
  88.    protected void RemoveColumn(ViewColumn var1) throws NotesException {
  89.       Vector var2 = this.columns;
  90.       synchronized(var2){}
  91.  
  92.       try {
  93.          this.columns.removeElement(var1);
  94.       } catch (Throwable var4) {
  95.          throw var4;
  96.       }
  97.  
  98.    }
  99.  
  100.    protected ViewColumn FindOrCreateColumn(int var1) throws NotesException {
  101.       ((NotesBase)this).CheckObject();
  102.       if (var1 == 0) {
  103.          return null;
  104.       } else {
  105.          Vector var4 = this.columns;
  106.          synchronized(var4){}
  107.  
  108.          ViewColumn var3;
  109.          try {
  110.             Enumeration var6 = this.columns.elements();
  111.  
  112.             ViewColumn var2;
  113.             do {
  114.                if (!var6.hasMoreElements()) {
  115.                   var3 = new ViewColumn(this, var1);
  116.                   return var3;
  117.                }
  118.  
  119.                var2 = (ViewColumn)var6.nextElement();
  120.             } while(!((NotesBase)var2).isEqual(var1));
  121.  
  122.             var3 = var2;
  123.          } catch (Throwable var8) {
  124.             throw var8;
  125.          }
  126.  
  127.          return var3;
  128.       }
  129.    }
  130.  
  131.    public void recycle() throws NotesException {
  132.       try {
  133.          this.database.RemoveView(this);
  134.          Enumeration var3 = this.columns.elements();
  135.  
  136.          while(var3.hasMoreElements()) {
  137.             ViewColumn var4 = (ViewColumn)var3.nextElement();
  138.             super.RecycleObject(var4);
  139.          }
  140.       } catch (NotesException var7) {
  141.       } finally {
  142.          this.columns.removeAllElements();
  143.          super.Recycle();
  144.       }
  145.  
  146.    }
  147.  
  148.    public int GetCppObj() {
  149.       return super.GetCppObj();
  150.    }
  151.  
  152.    public void clear() throws NotesException {
  153.       ((NotesBase)this).CheckObject();
  154.       synchronized(this){}
  155.  
  156.       try {
  157.          this.Nclear();
  158.       } catch (Throwable var3) {
  159.          throw var3;
  160.       }
  161.  
  162.    }
  163.  
  164.    public int FTSearch(String var1, int var2) throws NotesException {
  165.       ((NotesBase)this).CheckObject();
  166.       synchronized(this){}
  167.  
  168.       int var3;
  169.       try {
  170.          var3 = this.NFTSearch(var1, var2);
  171.       } catch (Throwable var7) {
  172.          throw var7;
  173.       }
  174.  
  175.       return var3;
  176.    }
  177.  
  178.    public int FTSearch(String var1) throws NotesException {
  179.       return this.FTSearch(var1, 0);
  180.    }
  181.  
  182.    public Document getChild(Document var1) throws NotesException {
  183.       ((NotesBase)this).CheckObject();
  184.       synchronized(this){}
  185.  
  186.       Document var2;
  187.       try {
  188.          var2 = this.database.FindOrCreateDocument(this.NgetChild(var1));
  189.       } catch (Throwable var6) {
  190.          throw var6;
  191.       }
  192.  
  193.       return var2;
  194.    }
  195.  
  196.    public Document getDocumentByKey(Vector var1) throws NotesException {
  197.       return this.getDocumentByKey(var1, false);
  198.    }
  199.  
  200.    public Document getDocumentByKey(Vector var1, boolean var2) throws NotesException {
  201.       ((NotesBase)this).CheckObject();
  202.       synchronized(this){}
  203.  
  204.       Document var3;
  205.       try {
  206.          var3 = this.database.FindOrCreateDocument(this.NgetDocumentByKey(var1, var2));
  207.       } catch (Throwable var7) {
  208.          throw var7;
  209.       }
  210.  
  211.       return var3;
  212.    }
  213.  
  214.    public Document getDocumentByKey(Object var1) throws NotesException {
  215.       Vector var2 = new Vector(1);
  216.       var2.addElement(var1);
  217.       return this.getDocumentByKey(var2, false);
  218.    }
  219.  
  220.    public Document getDocumentByKey(Object var1, boolean var2) throws NotesException {
  221.       Vector var3 = new Vector(1);
  222.       var3.addElement(var1);
  223.       return this.getDocumentByKey(var3, var2);
  224.    }
  225.  
  226.    public DocumentCollection getAllDocumentsByKey(Vector var1) throws NotesException {
  227.       return this.getAllDocumentsByKey(var1, false);
  228.    }
  229.  
  230.    public DocumentCollection getAllDocumentsByKey(Vector var1, boolean var2) throws NotesException {
  231.       ((NotesBase)this).CheckObject();
  232.       synchronized(this){}
  233.  
  234.       DocumentCollection var3;
  235.       try {
  236.          var3 = this.database.FindOrCreateDocCollection(this.NgetAllDocumentsByKey(var1, var2));
  237.       } catch (Throwable var7) {
  238.          throw var7;
  239.       }
  240.  
  241.       return var3;
  242.    }
  243.  
  244.    public DocumentCollection getAllDocumentsByKey(Object var1) throws NotesException {
  245.       Vector var2 = new Vector(1);
  246.       var2.addElement(var1);
  247.       return this.getAllDocumentsByKey(var2, false);
  248.    }
  249.  
  250.    public DocumentCollection getAllDocumentsByKey(Object var1, boolean var2) throws NotesException {
  251.       Vector var3 = new Vector(1);
  252.       var3.addElement(var1);
  253.       return this.getAllDocumentsByKey(var3, var2);
  254.    }
  255.  
  256.    public Document getFirstDocument() throws NotesException {
  257.       ((NotesBase)this).CheckObject();
  258.       synchronized(this){}
  259.  
  260.       Document var1;
  261.       try {
  262.          var1 = this.database.FindOrCreateDocument(this.NgetFirstDocument());
  263.       } catch (Throwable var5) {
  264.          throw var5;
  265.       }
  266.  
  267.       return var1;
  268.    }
  269.  
  270.    public Document getLastDocument() throws NotesException {
  271.       ((NotesBase)this).CheckObject();
  272.       synchronized(this){}
  273.  
  274.       Document var1;
  275.       try {
  276.          var1 = this.database.FindOrCreateDocument(this.NgetLastDocument());
  277.       } catch (Throwable var5) {
  278.          throw var5;
  279.       }
  280.  
  281.       return var1;
  282.    }
  283.  
  284.    public Document getNextDocument(Document var1) throws NotesException {
  285.       ((NotesBase)this).CheckObject();
  286.       synchronized(this){}
  287.  
  288.       Document var2;
  289.       try {
  290.          var2 = this.database.FindOrCreateDocument(this.NgetNextDocument(var1));
  291.       } catch (Throwable var6) {
  292.          throw var6;
  293.       }
  294.  
  295.       return var2;
  296.    }
  297.  
  298.    public Document getNextSibling(Document var1) throws NotesException {
  299.       ((NotesBase)this).CheckObject();
  300.       synchronized(this){}
  301.  
  302.       Document var2;
  303.       try {
  304.          var2 = this.database.FindOrCreateDocument(this.NgetNextSibling(var1));
  305.       } catch (Throwable var6) {
  306.          throw var6;
  307.       }
  308.  
  309.       return var2;
  310.    }
  311.  
  312.    public Document getNthDocument(int var1) throws NotesException {
  313.       ((NotesBase)this).CheckObject();
  314.       synchronized(this){}
  315.  
  316.       Document var2;
  317.       try {
  318.          var2 = this.database.FindOrCreateDocument(this.NgetNthDocument(var1));
  319.       } catch (Throwable var6) {
  320.          throw var6;
  321.       }
  322.  
  323.       return var2;
  324.    }
  325.  
  326.    public Document getParentDocument(Document var1) throws NotesException {
  327.       ((NotesBase)this).CheckObject();
  328.       synchronized(this){}
  329.  
  330.       Document var2;
  331.       try {
  332.          var2 = this.database.FindOrCreateDocument(this.NgetParentDocument(var1));
  333.       } catch (Throwable var6) {
  334.          throw var6;
  335.       }
  336.  
  337.       return var2;
  338.    }
  339.  
  340.    public Document getPrevDocument(Document var1) throws NotesException {
  341.       ((NotesBase)this).CheckObject();
  342.       synchronized(this){}
  343.  
  344.       Document var2;
  345.       try {
  346.          var2 = this.database.FindOrCreateDocument(this.NgetPrevDocument(var1));
  347.       } catch (Throwable var6) {
  348.          throw var6;
  349.       }
  350.  
  351.       return var2;
  352.    }
  353.  
  354.    public Document getPrevSibling(Document var1) throws NotesException {
  355.       ((NotesBase)this).CheckObject();
  356.       synchronized(this){}
  357.  
  358.       Document var2;
  359.       try {
  360.          var2 = this.database.FindOrCreateDocument(this.NgetPrevSibling(var1));
  361.       } catch (Throwable var6) {
  362.          throw var6;
  363.       }
  364.  
  365.       return var2;
  366.    }
  367.  
  368.    public void refresh() throws NotesException {
  369.       ((NotesBase)this).CheckObject();
  370.       synchronized(this){}
  371.  
  372.       try {
  373.          this.Nrefresh();
  374.       } catch (Throwable var3) {
  375.          throw var3;
  376.       }
  377.  
  378.    }
  379.  
  380.    public void remove() throws NotesException {
  381.       ((NotesBase)this).CheckObject();
  382.       synchronized(this){}
  383.  
  384.       try {
  385.          this.Nremove();
  386.          this.database.RemoveView(this);
  387.          super.cpp_object = 0;
  388.          this.finalize();
  389.       } catch (Throwable var3) {
  390.          throw var3;
  391.       }
  392.  
  393.    }
  394.  
  395.    public DateTime getCreated() throws NotesException {
  396.       ((NotesBase)this).CheckObject();
  397.       synchronized(this){}
  398.  
  399.       DateTime var1;
  400.       try {
  401.          var1 = this.database.getParent().FindOrCreateDateTime(((NotesBase)this).PropGetDate(1282));
  402.       } catch (Throwable var5) {
  403.          throw var5;
  404.       }
  405.  
  406.       return var1;
  407.    }
  408.  
  409.    public DateTime getLastModified() throws NotesException {
  410.       ((NotesBase)this).CheckObject();
  411.       synchronized(this){}
  412.  
  413.       DateTime var1;
  414.       try {
  415.          var1 = this.database.getParent().FindOrCreateDateTime(((NotesBase)this).PropGetDate(1281));
  416.       } catch (Throwable var5) {
  417.          throw var5;
  418.       }
  419.  
  420.       return var1;
  421.    }
  422.  
  423.    public String getName() throws NotesException {
  424.       ((NotesBase)this).CheckObject();
  425.       synchronized(this){}
  426.  
  427.       String var1;
  428.       try {
  429.          var1 = ((NotesBase)this).PropGetString(1280);
  430.       } catch (Throwable var5) {
  431.          throw var5;
  432.       }
  433.  
  434.       return var1;
  435.    }
  436.  
  437.    public String toString() {
  438.       String var1;
  439.       try {
  440.          var1 = this.getName();
  441.       } catch (Exception var2) {
  442.          var1 = null;
  443.       }
  444.  
  445.       return var1;
  446.    }
  447.  
  448.    public String getUniversalID() throws NotesException {
  449.       ((NotesBase)this).CheckObject();
  450.       synchronized(this){}
  451.  
  452.       String var1;
  453.       try {
  454.          var1 = ((NotesBase)this).PropGetString(1283);
  455.       } catch (Throwable var5) {
  456.          throw var5;
  457.       }
  458.  
  459.       return var1;
  460.    }
  461.  
  462.    public Database getParent() throws NotesException {
  463.       ((NotesBase)this).CheckObject();
  464.       return this.database;
  465.    }
  466.  
  467.    public boolean isDefaultView() throws NotesException {
  468.       ((NotesBase)this).CheckObject();
  469.       synchronized(this){}
  470.  
  471.       boolean var1;
  472.       try {
  473.          var1 = ((NotesBase)this).PropGetBool(1285);
  474.       } catch (Throwable var5) {
  475.          throw var5;
  476.       }
  477.  
  478.       return var1;
  479.    }
  480.  
  481.    public boolean isFolder() throws NotesException {
  482.       ((NotesBase)this).CheckObject();
  483.       synchronized(this){}
  484.  
  485.       boolean var1;
  486.       try {
  487.          var1 = ((NotesBase)this).PropGetBool(1287);
  488.       } catch (Throwable var5) {
  489.          throw var5;
  490.       }
  491.  
  492.       return var1;
  493.    }
  494.  
  495.    public Vector getColumns() throws NotesException {
  496.       ((NotesBase)this).CheckObject();
  497.       synchronized(this){}
  498.  
  499.       Vector var1;
  500.       try {
  501.          int[] var4 = ((NotesBase)this).PropGetObjArray(1286);
  502.          if (var4.length != 0) {
  503.             Vector var7 = new Vector(var4.length);
  504.  
  505.             for(int var6 = 0; var6 < var4.length; ++var6) {
  506.                ViewColumn var5 = this.FindOrCreateColumn(var4[var6]);
  507.                var7.addElement(var5);
  508.             }
  509.  
  510.             var1 = var7;
  511.             return var1;
  512.          }
  513.  
  514.          var1 = null;
  515.       } catch (Throwable var9) {
  516.          throw var9;
  517.       }
  518.  
  519.       return var1;
  520.    }
  521.  
  522.    public Vector getReaders() throws NotesException {
  523.       ((NotesBase)this).CheckObject();
  524.       synchronized(this){}
  525.  
  526.       Vector var2;
  527.       try {
  528.          String[] var5 = ((NotesBase)this).PropGetStringArray(1302);
  529.          Vector var1;
  530.          if (var5 != null && var5.length > 0) {
  531.             var1 = new Vector(var5.length, 1);
  532.  
  533.             for(int var6 = 0; var6 < var5.length; ++var6) {
  534.                var1.addElement(var5[var6]);
  535.             }
  536.          } else {
  537.             var1 = new Vector(1);
  538.          }
  539.  
  540.          var2 = var1;
  541.       } catch (Throwable var8) {
  542.          throw var8;
  543.       }
  544.  
  545.       return var2;
  546.    }
  547.  
  548.    public void setReaders(Vector var1) throws NotesException {
  549.       ((NotesBase)this).CheckObject();
  550.       synchronized(this){}
  551.  
  552.       try {
  553.          ((NotesBase)this).PropSetVector(1302, var1);
  554.       } catch (Throwable var4) {
  555.          throw var4;
  556.       }
  557.  
  558.    }
  559.  
  560.    public boolean isAutoUpdate() throws NotesException {
  561.       ((NotesBase)this).CheckObject();
  562.       synchronized(this){}
  563.  
  564.       boolean var1;
  565.       try {
  566.          var1 = ((NotesBase)this).PropGetBool(1303);
  567.       } catch (Throwable var5) {
  568.          throw var5;
  569.       }
  570.  
  571.       return var1;
  572.    }
  573.  
  574.    public void setAutoUpdate(boolean var1) throws NotesException {
  575.       ((NotesBase)this).CheckObject();
  576.       synchronized(this){}
  577.  
  578.       try {
  579.          ((NotesBase)this).PropSetBool(1303, var1);
  580.       } catch (Throwable var4) {
  581.          throw var4;
  582.       }
  583.  
  584.    }
  585.  
  586.    public Vector getAliases() throws NotesException {
  587.       ((NotesBase)this).CheckObject();
  588.       synchronized(this){}
  589.  
  590.       Vector var2;
  591.       try {
  592.          String[] var5 = ((NotesBase)this).PropGetStringArray(1304);
  593.          Vector var1;
  594.          if (var5 != null && var5.length > 0) {
  595.             var1 = new Vector(var5.length, 1);
  596.  
  597.             for(int var6 = 0; var6 < var5.length; ++var6) {
  598.                var1.addElement(var5[var6]);
  599.             }
  600.          } else {
  601.             var1 = new Vector(1);
  602.          }
  603.  
  604.          var2 = var1;
  605.       } catch (Throwable var8) {
  606.          throw var8;
  607.       }
  608.  
  609.       return var2;
  610.    }
  611.  
  612.    public boolean isCalendar() throws NotesException {
  613.       ((NotesBase)this).CheckObject();
  614.       synchronized(this){}
  615.  
  616.       boolean var1;
  617.       try {
  618.          var1 = ((NotesBase)this).PropGetBool(1305);
  619.       } catch (Throwable var5) {
  620.          throw var5;
  621.       }
  622.  
  623.       return var1;
  624.    }
  625.  
  626.    public boolean isProtectReaders() throws NotesException {
  627.       ((NotesBase)this).CheckObject();
  628.       synchronized(this){}
  629.  
  630.       boolean var1;
  631.       try {
  632.          var1 = ((NotesBase)this).PropGetBool(1309);
  633.       } catch (Throwable var5) {
  634.          throw var5;
  635.       }
  636.  
  637.       return var1;
  638.    }
  639.  
  640.    public void setProtectReaders(boolean var1) throws NotesException {
  641.       ((NotesBase)this).CheckObject();
  642.       synchronized(this){}
  643.  
  644.       try {
  645.          ((NotesBase)this).PropSetBool(1309, var1);
  646.       } catch (Throwable var4) {
  647.          throw var4;
  648.       }
  649.  
  650.    }
  651. }
  652.