Skip to content

Introduce MappingCollection interfaces as modifiable views of a tree's internal mapping store #133

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

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

NebelNidas
Copy link
Member

@NebelNidas NebelNidas commented Apr 12, 2025

Contains some Generics fuckery, mostly due to the inability to represent V extends ElementMappingView super E. This is required since the collection holds elements of type E, but allows elements of type V to be added or queried via the *Compatible methods. Thankfully the API doesn't need to expose any of these internal shenanigans.

A byproduct of the PR's changes is that mapping trees' add methods now also accept read-only mapping element views, the code for converting such arguments to the tree's internal representation was already in place; this doesn't change the API semantics.

I also moved the getKind methods from MemoryMappingTree's internal mapping entry implementations directly to ElementMappingView and added default implementations for them, used for some minor optimizations in the mapping collections.

Supersedes #129.

@NebelNidas NebelNidas marked this pull request as ready for review April 12, 2025 14:45
Copy link
Member

@modmuss50 modmuss50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine, id like to get @sfPlayer1 's input on this as well as its quite a large change.

@modmuss50 modmuss50 requested a review from Player3324 April 13, 2025 14:20
@Override
public boolean remove(Object o) {
assertModifiable();
return backing.remove(o);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be handled by the tree instead.

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

Successfully merging this pull request may close these issues.

3 participants