pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SYSE | Edvin ...@syse.no>
Subject Why is TableView#getTableData() typed as List<?>?
Date Sat, 09 Jul 2011 18:48:21 GMT
I usually add a List of my domainObjects to the TableView on 
initialization, and then later add objects on the fly when more are 
created. Because of the typing on getTableData() however, I can't do:

tableView.getTableData().add(myDomainObject). I have to cast the 
getTableData() to either an untyped List or a List<MyDomainObject> and 
then perform the add. This is because of the following definition of the 
getTableData() method:

public List<?> getTableData() { }

What good does the <?> serve here? Sure, if TableView accepted a generic 
type argument that was used instead of ?, this would be super-handy, but 
now it just seems like an obstacle. I'm no generics expert, so I guess 
it is a good reason for this though? :)

-- Edvin

Mime
View raw message