That depends, if you are going to have 1 Class per Record, then you could do something 
like:
But if you need to reference each record by name, then you can either add a "name 
Attribute to the Record like:

class Record {
private String name;
private ArrayList record;

public void setSubRecord(Record subRecord){...}
public Record getSubRecord(String recordName){
   loop...
       if( record.getName().equals(recordName) )
           return record;
}

public void setName(String name){...}
public String getName(){...}

}

Then you can just search each RecordObject in the ArrayList.

Of coarse you can always look at a HashMap as well.

  _____  

Thank You
 
Mick Knutson
 
Sr. Designer - Project Trust
aUBS AG, Financial - Zürich
Office: +41 (0)1/234.42.75
Internal: 48194
Mobile: 079.726.14.26
  _____  



-----Original Message-----
From: Richard Raquepo [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2003 10:22 AM
To: Struts Users Mailing List
Subject: Re: creating my Class


how can show my record-subrecord?

    Record1    blah    blah
        Record1_sub_detail1    blah
        Record1_sub_detail1    blah
        Record1_sub_detail1    blah
    Record2    blah
    Record3    blah
        Record3_sub_detail1    blah

how will i put data and how will the matching be made.
i mean assuming i have a integer key, how is it done then.

 maybe you can show me some java code i will really appreciate it. thanks.


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 21, 2003 5:08 PM
Subject: RE: creating my Class


an ArrayList will hold Objects. an ArrayList is an object itself. So, the
ArrayList could contain other ArrayList's in it.


  _____

Thank You

Mick Knutson

Sr. Designer - Project Trust
aUBS AG, Financial - Zürich
Office: +41 (0)1/234.42.75
Internal: 48194
Mobile: 079.726.14.26
  _____



-----Original Message-----
From: Richard Raquepo [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2003 10:12 AM
To: Struts Users Mailing List
Subject: creating my Class


I am in the process of designing a class but coudn't figure out how to start
it because i'm thinking how
struts tags will display my info.

My expected output is like this

    Record1    blah    blah
        Record1_sub_detail1    blah
        Record1_sub_detail1    blah
        Record1_sub_detail1    blah
    Record2    blah
    Record3    blah
        Record3_sub_detail1    blah

I don't how will be the data type of my class probably it will look like
this:

    class Record {
        ArrayList record;
        ArrayList subrecord[];
    }


r really don't what to use really. Can someone give me some idea and also
how will i be able to display it in
my JSP using struts tags.

thanks a lot.

-Richard

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to