Methods inherited from class java.lang.Object

Constructor Detail

SearchHit

Constructor: creates a hit object from a single (1 dimensional) hit mapping array.

Parameters:

singleHit - the 1D hit mapping array

SearchHit

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.

Parameters:

groupHit - the 2D hit mapping array

Method Detail

hashCode

public int hashCode()

Overrides:

hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:

equals in class java.lang.Object

getSingleHit

public int[] getSingleHit()

Returns the single hit view of the hit object.

The single hit is a simple array of int values 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_VALUE in case of 0 heavy 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 Integer.MIN_VALUE for 0 index.
SearchConstants.HIT_LP is 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_MULTICENTER for 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_MATCH denoting the match to an empty group.

getGroupHit

public int[][] getGroupHit()

Returns the group hit view of the hit object.

The group hit is an array of int arrays 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 SearchConstants.UNDEF_R_MATCHING_GROUP_H_EMPTY).

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.