@PublicAPI public class SearchHit extends java.lang.Object
single hit
and group hit
.Constructor and Description |
---|
SearchHit(int[] singleHit)
Constructor: creates a hit object from a single (1 dimensional) hit mapping array.
|
SearchHit(int[][] groupHit)
Constructor: creates a hit object from a group (2 dimensional) hit mapping array.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int[][] |
getGroupHit()
Returns the group hit view of the hit object.
|
int[] |
getSingleHit()
Returns the single hit view of the hit object.
|
int |
hashCode() |
java.lang.String |
toString() |
public SearchHit(int[] singleHit)
singleHit
- the 1D hit mapping arraypublic SearchHit(int[][] groupHit)
Warning: The given array is not copied for efficiency reasons. Do not modify it after passing to this constructor.
groupHit
- the 2D hit mapping arraypublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int[] getSingleHit()
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.
Integer.MIN_VALUE
in case of 0
heavy atom index.
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).
SearchConstants.HIT_MULTICENTER
for these atoms.
SearchConstants.HIT_R_EMPTY_MATCH
denoting the match to an empty group.
SearchConstants.HIT_UNMAPABLE
in the match
array.
SearchConstants.HIT_EXCLUDEDQ
value.
getGroupHit()
public int[][] getGroupHit()
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.
getSingleHit()
public java.lang.String toString()
toString
in class java.lang.Object