Does DataRow support equals() and hashCode()?

Does DataRow support equals() and hashCode()? I think the answer is no, it just relies on the default implementation in Object. It matters, because I need to compare rows and store them in HashMaps.

So is there some other built-in Knime data type to do that, or do I have to roll my own?

[I tracked down the implementation of sort(), and it seems to copy the data out into an ArrayList before using the Java collection classes. Is that the only way you do it?]

DataRow is an interface.

1 Like

It is indeed. So I’m looking for something that maybe implements DataRow, or some other similar or equivalent class that implements equals() and hashCode() so I can compare data rows and store them in a HashTable.

I found JoinTuple, which is pretty close. Are there any others I can look at?

Some concrete implementations of the interface override hashCode() and equals(Object) (e.g DefaultRow) and some do not (e.g BasisFunctionFilterRow) - even if something implements it, you may not consider it to be using an appropriate basis for your needs, of course.

The point of the question is to get help navigating this immense body of code and find fragments that will help solve my particular problem, either that I can call directly or that I can use as a model for how to do it. I found DefaultRow from the type hierarchy, but JoinTuple was a lucky guess. It’s not easy to know how to ask the right question to find things like that.