@PublicAPI public class SearchHit extends ObjectSearch hit object. It provides two different views:
- JChem 5.4
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
getGroupHit()Returns the group hit view of the hit object.
getSingleHit()Returns the single hit view of the hit object.
public SearchHit(int singleHit)Constructor: creates a hit object from a single (1 dimensional) hit mapping array.
singleHit- the 1D hit mapping array
public SearchHit(int groupHit)Constructor: creates a hit object from a group (2 dimensional) hit mapping array.
Warning: The given array is not copied for efficiency reasons. Do not modify it after passing to this constructor.
groupHit- the 2D hit mapping array
public int getSingleHit()Returns the single hit view of the hit object.
The single hit is a simple array of
intvalues so that the i-th element is the index of the target atom that is matched to the i-th query atom. In case of an R-group query, this array corresponds to the root of the query.
Special matching atom indexes:The hit array may contain special codes that are not valid indexes of the target structure. These special values are defined as follows.
- In case of explicit query H atoms matching to implied H atoms in the target, a negative number is returned.
The absolute value of this number equals with the atom index of the heavy atom bearing the implicit hydrogen, or
Integer.MIN_VALUEin case of
0heavy atom index.
- The same method is used for explicit LP (lone pair) atoms in the query. The hit contains the negated number
of the target heavy atom with the matching lone pair, or
SearchConstants.HIT_LPis set for isolated lone pairs (in which case there is no such target heavy atom).
- Multicenter atoms (e.g. of multicenter coordinate bonds) are not returned, the match array always contains
SearchConstants.HIT_MULTICENTERfor these atoms.
- In case of defined or undefined R-atom matching on a group of atoms: only one representative matched atom is set in the match array, or
SearchConstants.HIT_R_EMPTY_MATCHdenoting the match to an empty group.
- Unmapable atoms (e.g. polymer star atoms) are denoted by
SearchConstants.HIT_UNMAPABLEin the match array.
- Excluded query atoms receive the special
- All Superatom S-groups are treated as expanded during the search, so atom indices are returned accordingly.
- the single hit view of the hit object
- See Also:
- In case of explicit query H atoms matching to implied H atoms in the target, a negative number is returned. The absolute value of this number equals with the atom index of the heavy atom bearing the implicit hydrogen, or
public int getGroupHit()Returns the group hit view of the hit object.
The group hit is an array of
intarrays so that the i-th array contains the indexes of all target atoms that is matched to the i-th query atom. In contrast with the single hit, group hits allow multiple target atoms matching a single query atom. This can be the case if the query contains R-atoms or homology groups, because they may match several atoms in the target at once. In case of undefined R-atoms, empty match is denoted by an empty array (see
In group hits, the same special matching atom indexes are used as in single hits. See
getSingleHit()for their description.
Warning: For efficiency reasons, this method directly returns the internal array representation. Make a deep copy of the result if you would like to modify it.
- the group hit view of the hit object
- See Also: