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

Fix equals method not allowing override #5

Open
EdgarACarneiro opened this issue Mar 16, 2021 · 2 comments
Open

Fix equals method not allowing override #5

EdgarACarneiro opened this issue Mar 16, 2021 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@EdgarACarneiro
Copy link
Contributor

The current implementation does not allow the overriding of the FlatInterval.equals method since internally some FlatInterval objects are created to optimise data handling. As such, if one does override the equals method with the new properties, the search method brakes.

Possible solutions:

  • Stop creating FlatInterval objects inside the I2BplusTree and just use/ move around the valid times;
  • Create a new method (e.g. intervalEquals) that just makes the comparison of the intervals. Then, this method is used for comparison with the FlatInterval objects inside the tree, while the equals method is used for comparison between objects introduced by the user.
@EdgarACarneiro EdgarACarneiro added bug Something isn't working good first issue Good for newcomers labels Mar 16, 2021
@Nikovic
Copy link

Nikovic commented Sep 14, 2023

Hello. Is this bug/missing feature still around? I'm a little confused because overwriting equals is currently shown in the usage notes of the readme. If the bug is still around, a note in the readme might be a good idea.

I will be using I2Bplus-tree for a programming project in the context of my bachelor's thesis, and I'm open to contributing. Introducing the intervalEquals method seems like a good + fairly easy fix.

@EdgarACarneiro
Copy link
Contributor Author

Hey @Nikovic thanks for your question - I need to take a deeper look into it since it has been a while
I'll get back to you once I do so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants