-
Notifications
You must be signed in to change notification settings - Fork 26
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
Improvement - Collections for IPBlock and IP #69
Comments
Can you give an example? I'm not sure I understand what you want to do (compared to what the lib already offers). |
Okay let me try... The current IPBlock supports contain() isIn() and so on. Now imagine you have a list like an IP Blocklist Many IPs / Subnet prefixes let's say 100 Networks. Now you create for each network an IPBlock so you have now an array of 100 IPBlocks (IPBlockCollection) and you would like to check if each IPBlock contains in the other or vice versa to get an aggregated IPBlock array with only the elements which are not contained in any of the other blocks. This is the method aggregate() for example. The summarize() method give you just one IPBlock back / use the superblock method from IPBlock which contains all IPBlocks from the given array / collection. It's complex but already a use case which i often use. Maybe I can create a code example which makes this easier to understand. |
Let me try to reformulate to see if I understand correctly.
Some code example would definitely be helpful. |
Add Classes which are working as Collections at least for IPBlock. These collection could contain one or many IPBlock Objects and could implement same methods like contain(), isIn(), and so on. And additional methods like aggregate() which gives you back a collection of aggregated IPBlocks. Also a method summarize() which gives you back an IPBlock Object where all given IPBlock Objects in a given collection belongs to. All these things I do always by my own classes, but I think this could also fit into this library and will improve them.
The text was updated successfully, but these errors were encountered: