You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should work sufficiently well for now and for TrackMate3 use case but it's not really correct.
There are two problems:
obj might be from a different pool.
the equals() method of the concrete PoolObject instance might be overridden.
In both cases, contains() will do the wrong thing.
PoolObjectList.contains() is just an example of the general problem. We will have to decide on a consistent way to handle equality and then implement it everywhere...
The text was updated successfully, but these errors were encountered:
For issue 1, we could first check if the 2 pools (the one of the list and the one of the object) are equal.
I thought that would be an easy solution, but it forbids exchanging object between pools.
Object is not a good name for this thing imho -
For issue 2, I see no solution. We may have to give up and say that "equality is not implemented in the same sense than for Object. That is: bby construction equality is limited to check whether the two pools are equal (the same Object) and then if the two things points to the same index in the pool. Anything else cannot be done."
Currently, for example
PoolObjectList.contains(obj)
checks whether an object with the same internal id asobj
is contained in the list:This should work sufficiently well for now and for TrackMate3 use case but it's not really correct.
There are two problems:
obj
might be from a different pool.equals()
method of the concretePoolObject
instance might be overridden.In both cases,
contains()
will do the wrong thing.PoolObjectList.contains()
is just an example of the general problem. We will have to decide on a consistent way to handle equality and then implement it everywhere...The text was updated successfully, but these errors were encountered: