Skip to content

Collection to handle possibly colliding items

Matt requested to merge dev/fix-265 into master

Review the collection implementation to handle the case where 'identical' objects are added. This is especially true for purchases (same NACRE code). Prior to this patch we lost the index on the first such item added (there was an implicit convention that item were equal if their hashes were equal). This patch makes sure we can add items with the same hash value in the collection. we keep track of all elements in the indexes Map (whose values are now a list of index). In other words Collection looks like more like a hash table.

Non functionnal changes:

  • Make Collection more generic: GHGI Module related methods (like isInvalid, deleteSource) are moved outside
  • Introduce a ModuleCollection object that deals with Collection of GHGI modules (inherit from Collection)
  • make all of the collection modules(PurchaseCollection, TravelCollection, ...) inherit ModuleCollection

Fix #265 (closed)

Merge request reports