I am working on fixing https://jira.codehaus.org/browse/GEOT-4963
(See https://github.com/geotools/geotools/pull/654), and ran into an
interesting dilema:

What happens if we have a class that extends ContentFeatureSource, and
implements canLimit, but not canOffset? Then, if the internal count
retrieved from the implementing class is equal to the limit, we have no way
of knowing the correct count.

Currently, there are no classes that implement one but not the other, but
is this something we should be concerned about handling?

Here is a detailed breakdown of what could happen in the situation
described above:

Total count = N
Offset = S
Limit = M

Case 1:
N-L <= M
Max features never applied, correct answer.

Case 2:
N-L < M but N > M
Extending class returns M, and we have no way of knowing what N was, and
the correct answer is actually less than M.

Case 3:
N-L >= M
Extending class returns M, and again we have no way of knowing what N was.
However, in this case it is correct to return M.

Torben
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to