Passing a container Class into a frame?

From: Shaun Marshall (shaun.marshall_at_blueyonder.co.uk)
Date: 12/01/03

  • Next message: Alex Ostrikov: "Call CORBA object from servlet"
    Date: Mon, 1 Dec 2003 22:40:37 -0000
    
    

    Hope someone can help, for an assignment i was given a starter application
    package, with that starter package i had to create some employee classes and
    test harnesses. below iv pasted my Container class, which holds a company
    eomployee class , the Company class and the Data holding class. I am
    somehow trying to pass the container class into the preset frame as seen in
    the attached file (Jdeveloper package file)
    hope someone can give some ideas, or examples i can work with.
    thanks in advance.

    Company Class:

    public class Company extends Employee {

      private String jobTitle;
      private String startDate;
      private String leavingDate;
      private double salary;

        public Company(String aName, String aAddress, String aEmail,
                   String aTelephone, String aTelExt, String aJobTitle ,String
    aStartDate, String aLeavingDate
                    , double aSalary){

      super();
      this.name = aName;
      this.address = aAddress;
      this.email = aEmail;
      this.telephone = aTelephone;
      this.telExt = aTelExt;
      this.jobTitle = aJobTitle;
      this.startDate = aStartDate;
      this.leavingDate = aLeavingDate;
      this.salary = aSalary;
      }

       public String toString(){
      return ("Name : "+ name + " -\n Address: " + address
              + "-\n Email: " + email + "-\n Telephone: "
              + telephone + "-\n ID:" + idNo + "-\n Jobtitle: "
              + jobTitle + "-\n StartDate: " + startDate + "-\n Leaving Date: "
              + leavingDate + "-\n Salary: " + salary);
      }
    }

    Container Class:

    public class CompanyContainerClass extends Object {

      private static Vector company = new Vector();

      public int getItemCount(){
        return company.size();
        }

      public Company getString(int index){
      return (Company)company.elementAt(index);
      }

      public void addString(Company newString){
      company.add(newString);
      }

      public void addElement(Company newString){
      company.addElement(newString);
      }
    }

    Data Holding Class/ pass to container :

    public class CompanyDataClass extends Object {

    public static CompanyContainerClass c = new CompanyContainerClass();

      public static void buildCompanyObjects() {

      Company company1 = new Company(

        "Shaun Marshall"
        ,"East Kilbride"
        ,"shaun.marshall@blueyonder.co.uk"
        ,"265461"
        ,"229"
        ,"Chef De Parte"
        ,"06/10/02"
        ," "
        ,13500d);

        Company company2 = new Company(
        "Donald Duck"
        ,"33Boat Pond"
        ,"donald@duckland.com"
        ,"236699"
        ,"221"
        ,"Security"
        ,"11/04/00"
        ,"23/02/03"
        ,8500d);

        Company company3 = new Company(
        "George Bush"
        ,"The White House"
        ,"georg@thewhiteouse.com"
        ,"02699 555"
        ,"666"
        ,"Diplamatic Ambasidor"
        ,"01/01/99"
        ," "
        ,21000d );

        Company company4 = new Company(
        "Lorna Marshall"
        ,"Appleby Close"
        ,"lorna.marshall@ntl.com"
        ,"265461"
        ,"369"
        ,"Facilities Manager"
        ,"01/03/01"
        ," "
        ,23000d);

        c.addString(company1); // Company objects are referenced by the
        c.addString(company2); // CompanyContainerClass
        c.addString(company3);
        c.addString(company4);

      for (int i = 0 ; i < c.getItemCount(); i ++) {
      System.out.println(c.getString(i));
      }// prints all items in the Container

    begin 666 PersonnelDatabase.jws
    M.T]R86-L92!*1&5V96QO<&5R("TM(%=/4DM34$%#12!&24Q%(%9%4E-)3TX@
    M>S,N,#%]("T@9&\@;F]T(&%L=&5R('1H:7,@;&EN92$-"B,P/5!E<G-O;FYE
    M;$1A=&%B87-E+FIW<PT*(S$]+EQ#;VYN96-T:6]N<RYC;VX-"B,R/2Y<4&5R
    M<V]N;F5L1&%T86)A<V4N:G!R#0ID96)U9ULP72YB<# ],0T*9&5B=6=;,%TN
    M8G P0E!4/3(-"F1E8G5G6S!=+F)P,$5N86)L960],0T*<WES6S!=+D%C=&EV
    M95!R;VIE8W0],@T*<WES6S!=+D)R96%K<&]I;G1S/3 L,C@Y+#,P."PT-#4L
    M,34Q+# L,"PP+#0T-2PQ-3$-"G-Y<ULP72YB<F]W<V4],3@Q#0IS>7-;,%TN
    M9&5B=6<Q/3(P-PT*<WES6S!=+F1E8G5G,CTR-C -"G-Y<ULP72Y$969A=6QT
    M1&ER/0T*<WES6S!=+F1I<G9I97<],C0S#0IS>7-;,%TN26YS<&5C=&]R/3 L
    M+3<S-"PS,S$L,SDW+#(T,2PP+#0L+3(L,SDW+#(T,0T*<WES6S!=+DQA<W14
    M86<],@T*<WES6S!=+DQO861E9$-L87-S/3 L,C8S+#$T-BPS-#@L,S0R+# L
    M,"PP+#,T."PS-#(-"G-Y<ULP72Y-86EN5VEN9&]W/2TT+"TT+#@P,"PV,# L
    M,@T*<WES6S!=+DUS9U9I97<],"PQ,BPQ+#,Y-RPR-#$L,2PR+"TR+#<X-RPY
    M- T*<WES6S!=+DYA=FEG871O<CTP+#$L,3(L,C,X+#(V.2PQ+#,L+3(L,3DP
    M+#,Q-@T*<WES6S!=+DY086YE;',]5$)A<D9I;&4L5$)A<D5D:70L5$)A<E)U
    M;BQ40F%R4V5A<F-H+%!A;&5T=&4L4&]R=#$L4&]R=#(L4&]R=#0L4&]R=#,L
    M3F%V:6=A=&]R+$EN<W!E8W1O<BQ-<V=6:65W+$)R96%K<&]I;G1S+$QO861E
    M9$-L87-S#0IS>7-;,%TN3W!E;F5D1FEL93$]+EQM>61O8W-<4&5R<V]N;F5L
    M1&%T86)A<V5<1&%T84-O;&QE8W1I;VY$:6%L;V<N:'1M; T*<WES6S!=+D]P
    M96YE9$9I;&4R/2Y<;7ED;V-S7%!E<G-O;FYE;$1A=&%B87-E7$1A=&%#;VQL
    M96-T:6]N1&EA;&]G5&5S="YH=&UL#0IS>7-;,%TN3W!E;F5D1FEL93,]+EQM
    M>61O8W-<4&5R<V]N;F5L1&%T86)A<V5<4&5R<V]N;F5L1&%T86)A<V5!<' N
    M:'1M; T*<WES6S!=+D]P96YE9$9I;&4T/2Y<;7ED;V-S7%!E<G-O;FYE;$1A
    M=&%B87-E7%!E<G-O;FYE;$1A=&%B87-E07!P1G)A;64N:'1M; T*<WES6S!=
    M+D]P96YE9$9I;&4U/2Y<;7ED;V-S7'-E<FEA;&EZ960M9F]R;2YH=&UL#0IS
    M>7-;,%TN3W!E;F5D1FEL938]+EQM>61O8W-<4&5R<V]N;F5L1&%T86)A<V5<
    M571I;&ET>4QI8G)A<GDN:'1M; T*<WES6S!=+D]P96YE9$9I;&5#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4&%T:#$Q/2Y<;7EP<F]J96-T<UQ097)S
    M;VYN96Q$871A8F%S95Q#;VUP86YY+FIA=F$-"G-Y<ULP72Y6:65W97)S4&%T
    M:#$R/2Y<;7EP<F]J96-T<UQ097)S;VYN96Q$871A8F%S95Q%;7!L;WEE92YJ
    M879A#0IS>7-;,%TN5FEE=V5R<U!A=&@Q,STN7&UY<')O:F5C='-<4&5R<V]N
    M;F5L1&%T86)A<V5<0V]N=')A8W1O<BYJ879A#0IS>7-;,%TN5FEE=V5R<U!A
    M=&@Q-#TN7&UY<')O:F5C='-<4&5R<V]N;F5L1&%T86)A<V5<0V]M<&%N>41A
    M=&%#;&%S<RYJ879A#0IS>7-;,%TN5FEE=V5R<U!A=&@Q-3TN7&UY<')O:F5C
    M='-<4&5R<V]N;F5L1&%T86)A<V5<4&5R<V]N;F5L1&%T86)A<V5!<' N:F%V
    M80T*<WES6S!=+E9I97=E<G-0871H,38]+EQM>7!R;VIE8W1S7%!E<G-O;FYE
    M;$1A=&%B87-E7$1A=&%#;VQL96-T:6]N1&EA;&]G+FIA=F$-"G-Y<ULP72Y6
    M:65W97)S4&%T:#(]+EQM>7!R;VIE8W1S7%!E<G-O;FYE;$1A=&%B87-E7$-O
    M;G1R86-T;W)$871A0VQA<W,N:F%V80T*<WES6S!=+E9I97=E<G-0871H,STN
    M7&UY<')O:F5C='-<4&5R<V]N;F5L1&%T86)A<V5<1&%T84-O;&QE8W1I;VY$
    M:6%L;V=497-T+FIA=F$-"G-Y<ULP72Y6:65W97)S4&%T:#0]+EQM>61O8W-<
    M4&5R<V]N;F5L1&%T86)A<V5<1&%T84-O;&QE8W1I;VY$:6%L;V<N:'1M; T*
    M<WES6S!=+E9I97=E<G-0871H-3TN7&UY9&]C<UQI;F1E>"YH=&UL#0IS>7-;
    M,%TN5FEE=V5R<U!A=&@V/2Y<;7ED;V-S7%!E<G-O;FYE;$1A=&%B87-E7%!E
    M<G-O;FYE;$1A=&%B87-E07!P1G)A;64N:'1M; T*<WES6S!=+E9I97=E<G-0
    M871H-STN7&UY9&]C<UQ097)S;VYN96Q$871A8F%S95Q$871A0V]L;&5C=&EO
    M;D1I86QO9U1E<W0N:'1M; T*<WES6S!=+E9I97=E<G-0871H.#TN7&UY9&]C
    M<UQS97)I86QI>F5D+69O<FTN:'1M; T*<WES6S!=+E9I97=E<G-0871H.3TN
    M7&UY<')O:F5C='-<4&5R<V]N;F5L1&%T86)A<V5<571I;&ET>4QI8G)A<GDN
    M:F%V80T*<WES6S!=+G=O<FMS970],C0S#0IS>7-;,5TN4&%R96YT/3 -"G-Y
    /<ULR72Y087)E;G0], T*
    `
    end


  • Next message: Alex Ostrikov: "Call CORBA object from servlet"