def mergeEffectiveRowCol(self, i_maximum, j_maximum): """Merge the symbols i and j in the "symbols" structure @param i_maximum: id of the first symbol to merge @param j_maximum: id of the second symbol to merge @return the newly created symbol result of the merged process""" # Extract symbols i and j if i_maximum > j_maximum: symbol1 = self.symbols.pop(i_maximum) symbol2 = self.symbols.pop(j_maximum) else: symbol1 = self.symbols.pop(j_maximum) symbol2 = self.symbols.pop(i_maximum) # Merge the symbols i and j messages = [] messages.extend(symbol1.getMessages()) messages.extend(symbol2.getMessages()) newSymbol = Symbol(str(uuid.uuid4()), symbol1.getName(), self.project) newSymbol.setMinEqu(self.minEquivalence) for message in messages: newSymbol.addMessage(message) # Append th new symbol to the "symbols" structure self.symbols.append(newSymbol) return newSymbol.getID()
def mergeEffectiveRowCol(self, i_maximum, j_maximum): # Extract symbols i and j if i_maximum > j_maximum: symbol1 = self.symbols.pop(i_maximum) symbol2 = self.symbols.pop(j_maximum) else: symbol1 = self.symbols.pop(j_maximum) symbol2 = self.symbols.pop(i_maximum) # Merge the symbols i and j messages = [] messages.extend(symbol1.getMessages()) messages.extend(symbol2.getMessages()) newSymbol = Symbol(str(uuid.uuid4()), symbol1.getName(), self.project, minEqu=self.minEquivalence) for message in messages: newSymbol.addMessage(message) # Append th new symbol to the "symbols" structure self.symbols.append(newSymbol) return newSymbol.getID()