MCPcopy Create free account
hub / github.com/CDSecLab/MJXT / search

Method search

src/main/java/server/Server_JXTpp.java:44–74  ·  view source on GitHub ↗

the server operations of the search algorithm for JXT++ @param join_tokens jointokens @return the matching results

(ArrayList<byte[][]> join_tokens)

Source from the content-addressed store, hash-verified

42 * @return the matching results
43 */
44 public ArrayList<byte[][]> search(ArrayList<byte[][]> join_tokens) {
45 ArrayList<byte[][]> res = new ArrayList<>();
46 ArrayList<byte[]> token1_tset = tset.get(stag1);
47
48 for (int i = 0; i < token1_tset.size(); i++) {
49 byte[] token1 = token1_tset.get(i);
50 long[] xtoken1_long = new long[join_tokens.size()];
51 for (int j = 1; j < join_tokens.size(); j++) {
52 byte[] xtoken1 = tool.Xor(token1, join_tokens.get(j)[0]);
53 xtoken1_long[j] = tool.bytesToLong(xtoken1);
54 if (!f[j].mayContain(xtoken1_long[j])) {
55 break;
56 }
57 if (j == join_tokens.size() - 1) {
58 xtoken1_long[0] = tool.bytesToLong(tool.Xor(token1, join_tokens.get(0)[0]));
59 for (int k = 0; k < join_tokens.size(); k++) {
60 byte[][] join_token = join_tokens.get(k);
61 byte[][] ct = new byte[join_token.length][];
62 for (int h = 0; h < join_token.length; h++) {
63 long xtoken;
64 if (h == 0) xtoken = xtoken1_long[k];
65 xtoken = tool.bytesToLong(tool.Xor(token1, join_token[h]));
66 ct[h] = xor[k].search(xtoken);
67 }
68 res.add(ct);
69 }
70 }
71 }
72 }
73 return res;
74 }
75}

Callers 3

mainMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95

Calls 4

XorMethod · 0.80
bytesToLongMethod · 0.80
mayContainMethod · 0.80
addMethod · 0.80

Tested by 3

mainMethod · 0.76
mainMethod · 0.76
mainMethod · 0.76