@PublicAPI public class Changes extends java.lang.Object
newToOld()
and oldToNew()
newToOld(List, Molecule)
and
newToOld(List, Molecule)
Changes
object is possible using
append(Changes)
method.Constructor and Description |
---|
Changes(Molecule original)
Initializes the changes object.
|
Changes(Molecule original,
Molecule result)
Initializes the changes object.
|
Changes(Molecule molecule,
StandardizerAction action)
Initializes the changes object.
|
Modifier and Type | Method and Description |
---|---|
void |
addAllAtoms(java.util.Collection<MolAtom> atoms)
Adds atoms to the "added atom" list.
|
void |
addAllAtoms(java.util.Collection<MolAtom> atoms,
boolean cleanRelevant)
Adds atoms to the "added atom" list.
|
void |
addAtom(MolAtom atom)
Adds an atom to the "added atom" list.
|
void |
addAtom(MolAtom atom,
boolean cleanRelevant)
Adds an atom to the "added atom" list.
|
void |
append(Changes changes)
Appends a set of changes to the already existing changes.
|
StandardizerAction |
getAction()
Gets the base
StandardizerAction of the changes |
java.util.List<MolAtom> |
getAddedAtoms()
Gets the list of atoms added during the standardization procedure
|
java.util.List<MolAtom> |
getCleanRelevantAtoms()
Gets the list of atoms changed during the standardization procedure, and
needs to be cleaned
|
java.util.List<MolAtom> |
getModifiedAtoms()
Gets the list of modified atoms during the standardization procedure
|
Molecule |
getOriginal()
Gets the original molecule of the standardization process.
|
java.util.List<MolAtom> |
getRemovedAtoms()
Gets the list of atoms removed during the standardization procedure
|
Molecule |
getResult()
Gets the result molecule of the standardization process
|
boolean |
isModified()
Gets whether any modifications were applied on the molecule.
|
void |
modifyAllAtoms(java.util.Collection<MolAtom> atoms)
Adds atoms to the "modified atom" list.
|
void |
modifyAllAtoms(java.util.Collection<MolAtom> atoms,
boolean cleanRelevant)
Adds atoms to the "modified atom" list.
|
void |
modifyAtom(MolAtom atom)
Adds an atom to the "modified atom" list.
|
void |
modifyAtom(MolAtom atom,
boolean cleanRelevant)
Adds an atom to the "modified atom" list.
|
int[] |
newToOld()
Returns the new -> old atom index mapping.
newToOld[i]==j means that the i-th atom of the new molecule corresponds to the j-th atom of the old molecule. |
static int[] |
newToOld(java.util.List<Changes> changeList,
Molecule target)
Calculates the new -> old atom index mapping based on a list of
changes.
newToOld[i]==j means that the i-th atom of the new molecule corresponds to the j-th atom of the old molecule. |
int[] |
oldToNew()
Returns the old -> new atom index mapping.
oldToNew[i]==j means that the i-th atom of the old molecule corresponds to the j-th atom of the new molecule. |
static int[] |
oldToNew(java.util.List<Changes> changeList,
Molecule target)
Calculates the old -> new atom index mapping based on a list of
changes.
oldToNew[i]==j means that the i-th atom of the old molecule corresponds to the j-th atom of the new molecule. |
void |
removeAllAtoms(java.util.Collection<MolAtom> atoms)
Adds atoms to the "removed atom" list
|
void |
removeAllAtoms(java.util.Collection<MolAtom> atoms,
boolean cleanRelevant)
Adds atoms to the "removed atom" list
|
void |
removeAtom(MolAtom atom)
Adds an atom to the "removed atom" list.
|
void |
removeAtom(MolAtom atom,
boolean cleanRelevant)
Adds an atom to the "removed atom" list.
|
void |
setAction(StandardizerAction action)
Sets the base
StandardizerAction of the changes |
void |
setModified(boolean modified)
Sets whether any modifications were applied on the molecule.
|
java.lang.String |
toString() |
public Changes(Molecule original)
original
- the original moleculepublic Changes(Molecule original, Molecule result)
original
- the original moleculeresult
- the result molecule to be standardized. should be different of
the original moleculepublic Changes(Molecule molecule, StandardizerAction action)
molecule
- the original moleculeaction
- the action generating the changespublic Molecule getOriginal()
public Molecule getResult()
public java.util.List<MolAtom> getAddedAtoms()
public java.util.List<MolAtom> getRemovedAtoms()
public java.util.List<MolAtom> getModifiedAtoms()
public java.util.List<MolAtom> getCleanRelevantAtoms()
public void addAtom(MolAtom atom)
atom
- an atom to be added to the "added atom" list.public void addAtom(MolAtom atom, boolean cleanRelevant)
atom
- an atom to be added to the "added atom" list.cleanRelevant
- whether the atom is relevant for cleaning the output moleculepublic void removeAtom(MolAtom atom)
atom
- an atom to be added to the "removed atom" list.public void removeAtom(MolAtom atom, boolean cleanRelevant)
atom
- an atom to be added to the "removed atom" list.cleanRelevant
- whether the atom is relevant for cleaning the output moleculepublic void modifyAtom(MolAtom atom)
atom
- an atom to be added to the "modified atom" list.public void modifyAtom(MolAtom atom, boolean cleanRelevant)
atom
- an atom to be added to the "modified atom" list.cleanRelevant
- whether the atom is relevant for cleaning the output moleculepublic void addAllAtoms(java.util.Collection<MolAtom> atoms)
atoms
- atoms to be added to the "added atom" list.public void addAllAtoms(java.util.Collection<MolAtom> atoms, boolean cleanRelevant)
atoms
- atoms to be added to the "added atom" list.cleanRelevant
- whether the atoms are relevant for cleaning the output
moleculepublic void removeAllAtoms(java.util.Collection<MolAtom> atoms)
atoms
- atoms to be added to the "removed atom" listpublic void removeAllAtoms(java.util.Collection<MolAtom> atoms, boolean cleanRelevant)
atoms
- atoms to be added to the "removed atom" listcleanRelevant
- whether the atoms are relevant for cleaning the output
moleculepublic void modifyAllAtoms(java.util.Collection<MolAtom> atoms)
atoms
- atoms to be added to the "modified atom" list.public void modifyAllAtoms(java.util.Collection<MolAtom> atoms, boolean cleanRelevant)
atoms
- atoms to be added to the "modified atom" list.cleanRelevant
- whether the atoms are relevant for cleaning the output
moleculepublic void setModified(boolean modified)
modified
- whether any modifications were applied on the molecule.public boolean isModified()
public int[] oldToNew()
public int[] newToOld()
public static int[] oldToNew(java.util.List<Changes> changeList, Molecule target)
changeList
- the target list of changestarget
- the target molecule (needed in case of no changes)public static int[] newToOld(java.util.List<Changes> changeList, Molecule target)
changeList
- the target list of changestarget
- the target molecule (needed in case of no changes)public java.lang.String toString()
toString
in class java.lang.Object
public void append(Changes changes)
changes
- the set of changes to be appendedpublic StandardizerAction getAction()
StandardizerAction
of the changesStandardizerAction
of the changespublic void setAction(StandardizerAction action)
StandardizerAction
of the changesaction
- the base StandardizerAction
of the changes