Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use generics for index classes? #146

Open
dbaston opened this issue Sep 1, 2017 · 6 comments
Open

Use generics for index classes? #146

dbaston opened this issue Sep 1, 2017 · 6 comments

Comments

@dbaston
Copy link
Contributor

dbaston commented Sep 1, 2017

What do people think about updating some of the index classes to use generics? It would be nice to not cast the return values from spatial index queries, etc.

@dr-jts
Copy link
Contributor

dr-jts commented Sep 1, 2017

Possible reasons to NOT do this are:

  • in the past there were requests to keep JTS at 1.4 compatibility, for use on mobile
  • may prevent use of JSTS transpiler? @bjornharrtell, can you comment?

@bjornharrtell
Copy link
Contributor

May require some work on the transpilation but should not be too hard to fix.

@jnh5y
Copy link
Contributor

jnh5y commented Oct 28, 2017

Generally, I'm interested in seeing JTS attract folks who work on optimizing spatial indices. As an option for JTS 1.x, could we experiment with this in a JTS-indexing-labs package?

@dr-jts
Copy link
Contributor

dr-jts commented Nov 1, 2019

This would break current API, wouldn't it? I.e. would require classes to be instantiated specifying the contained type?

Or is it possible to make the generic type optional (but seems unlikely...)?

@dbaston
Copy link
Contributor Author

dbaston commented Nov 1, 2019

I thought it just defaulted to Object if you omitted it.

@dr-jts
Copy link
Contributor

dr-jts commented Nov 1, 2019

I thought it just defaulted to Object if you omitted it.

If so, that would be awesomely awesome! And indeed it appears you may be right: http://www.angelikalanger.com/GenericsFAQ/FAQSections/ParameterizedTypes.html#FAQ201

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants