List<? extends List<? extends ObservationInteger>>
Just to give you a background which probably has nothing to do with the question. Trying to use the JAHMM library to build and score HMM's.
One of the parameters to the functions mentions the above as the datatype and I have no idea what it means.
From what I understand with help from a friend
List<? extends ObservationInteger>
means a List of instances of any classes extending "ObservationInteger" which is a valid class in the library.
It is the outer List<? extends List<?...
that is confusing me.
Can someone throw some light on this?
List<? extends List...
means that it can be List of any Collections implementing List interface.
List<List<? extends ObservationInteger>> list = new ArrayList<List<ObservationInteger>>();
- compiler error because without ? extends
compiler requires exact match:
List<List<? ObservationInteger>> list = new ArrayList<List<? extends ObservationInteger>>();
- OK
but this looks better
List<? extends List<? ObservationInteger>> list = new ArrayList<List<ObservationInteger>>();
- OK
It means any Class implementing List Interface with instances of any Class implementing List Interface with instances of any classes extending "ObservationInteger"
It is a List
of Objects
, which are all instances of a class that extends List.
Because those objects are instances of Lists,
each of them happens to contain a certain amount of Objects
, which are all instances of a class that extends ObservationInteger
.
It's a list of lists of things. Visualize it as a two-dimensional structure (rows & columns).
The ? extends
means it is also valid for any subtypes of List and any subtypes of ObservationInteger.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With