The match method performs window matching and commonization. It matches and commonizes records, returning a read-only structure containing an array of matched records.
To work with the data returned by the match method, use the methods available in the following classes:
-
MatchResults provides access to data at the structure level (e.g., the size method returns the number of records in the structure).
-
MatchRecord provides access to data at the field level (e.g., the size method returns the number of fields in each record). Use the getString method with the index input to access individual fields.
Syntax
public MatchResults Match(int handle,
String returnFieldNames[],
int retCode[])
Parameters
Name |
Type |
Use |
Length |
Description |
---|---|---|---|---|
handle |
int |
In |
–– |
Handle to a Director matcher server instance. |
returnFieldNames |
string |
In |
|
Java string array of DDL field names. |
MatchResults |
|
out |
|
A MatchResults object containing the result of the records returned from the Matcher. |
retCode |
int |
Out |
|
Error code array. |
Return Values
Refer to Return Values.
Example
String[] fieldNames = {
"FirstName",
"LastName",
"MiddleName",
"HouseNo",
"StreetAddress",
"City",
"State",
"PostalCode",
"Country"
};
String[] DataValues1 = {
"JOHN",
"SMITH",
"D",
"25",
"Linnell cir",
"Billerica",
"MA",
"01821",
"US"
};
String[] DataValues2 = {
"JOHN",
"JONES",
"DAVID",
"164",
"Lexington rd",
"Billerica",
"MA",
"01821",
"US"
};
String[] DataValues3 = {
"J",
"SMITH",
"D",
"25",
"Linnell cir",
"Billerica",
"MA",
"01821",
"US"
};
int maxOut;
int fieldCount = 0;
// Misc stuff
int i;
MatchResults results = null;
String key;
testClient.clearWindow(handle, retCode);
System.out.println("open a matcher");
key = "JOHN1";
testClient.addToMatchWindow(handle, fieldNames, DataValues1, key, retCode);
key = "JOHN2";
testClient.addToMatchWindow(handle, fieldNames, DataValues2, key, retCode);
key = "JOHN3";
testClient.addToMatchWindow(handle, fieldNames, DataValues3, key, retCode);
results = testClient.match(handle, matchFields, retCode);