Answer the question
In order to leave comments, you need to log in
Data output from all sheets successors?
I have a super class, it has 2 heirs, each heir has a List. I need to merge these sheets, while the number of heirs with sheets can be added as needed. And you need to display the contents of all the sheets in the heirs through the super class in one fell swoop. The output should be one sheet in which there is data from all sheets. How can this be implemented? Where can you get info?
Answer the question
In order to leave comments, you need to log in
And you need to display the contents of all sheets in the heirs through the super class in one fell swoop
While this comes to mind: declare a sheet in the superclass, fill it in the heirs. In some external class (which is not included in this hierarchy), create a list of superclass heirs, and then loop through all of them and add elements from their lists to the general list.
Threat The only question here is with the types of elements. If one class is used for all products (that is, they all have the same characteristics), then the list can be immediately typed with this class. Otherwise, you can make the superclass a generic, and in each heir to determine the type of product; true, then all product types must have a common child (or common interface), etc...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question