singa-bio / singa

:leaves: SiNGA (Simulation of Natural Systems using Graph Automata) is an open-source library containing tools especially for structural bioinformatics and systems biology.
MIT License
8 stars 2 forks source link

override equals() for Substructures #30

Closed fkaiserbio closed 6 years ago

fkaiserbio commented 7 years ago
cleberecht commented 7 years ago

I would promote the idea of a deep equals deepEquals() method and a shallow equals equals() method. The deep equals method can recursively compare all substructures of the called substructure. The equals method should only compare the most relevant attributes that important for the identity at the current depth. Details are given in this stack overflow post and in the object java docs.

cleberecht commented 7 years ago

Affected classes:

RegularAtom

UncertainAtom

AtomContainer

Nucleotide

Residue

Chain

StructuralModel

StructuralMotif

Edit 1: Commit f6de9c2 revamps equals for leaf structures

cleberecht commented 6 years ago

Since version 0.3.1 this is fixed with the implementation of structures.