G
Guest
1. If I use an ArrayList as my data source, how do I construct the accessor
methods? That is, forget about properties for a moment, if I wanted the 5th
item in the ArrayList, I would write the method:
public string getTheField(int index) { ... } - where index would equal 4.
How is this written into the property? Does reflection take care of getting
the appropriate value?
2. Expanding on that, say I have an ArrayList of ArrayLists where the inner
ArrayLists correspond to rows in a database resultset. So, here the 5th field
in the outer ArrayList gets the 5th deeper ArrayList which is the 5th row of
data. Can the methods/properties be constructed to do this? If so, cold you
provide a brief example of the syntax. It would clear up some questions I
have. (I'm translating some old JSP code.)
Thank you for your time.
methods? That is, forget about properties for a moment, if I wanted the 5th
item in the ArrayList, I would write the method:
public string getTheField(int index) { ... } - where index would equal 4.
How is this written into the property? Does reflection take care of getting
the appropriate value?
2. Expanding on that, say I have an ArrayList of ArrayLists where the inner
ArrayLists correspond to rows in a database resultset. So, here the 5th field
in the outer ArrayList gets the 5th deeper ArrayList which is the 5th row of
data. Can the methods/properties be constructed to do this? If so, cold you
provide a brief example of the syntax. It would clear up some questions I
have. (I'm translating some old JSP code.)
Thank you for your time.