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

Method search

src/main/java/server/Server_JXTp.java:49–63  ·  view source on GitHub ↗

the server operations of the search algorithm for JXT+ @param stoken sjointoken in JXT+ @param xtoken xjointoken in JXT+ @return the matching results

(byte[][] stoken, byte[][] xtoken)

Source from the content-addressed store, hash-verified

47 * @return the matching results
48 */
49 public ArrayList<ArrayList<byte[]>> search(byte[][] stoken, byte[][] xtoken){
50 ArrayList<ArrayList<byte[]>> res = new ArrayList<>();
51
52 ArrayList<byte[]> token1_tset = tset.get(stag1);
53 for (int i = 0; i < token1_tset.size(); i++) {
54 byte[] xtoken_t = tool.Xor(xtoken[i], token1_tset.get(i));
55 long xtoken_long = tool.bytesToLong(xtoken_t);
56 if (f_2.mayContain(xtoken_long)){
57 byte[] stoken_t = tool.Xor(stoken[i], token1_tset.get(i));
58 res.add(cset1.get(tool.bytesToLong(stoken_t)));
59 res.add(cset2.get(xtoken_long));
60 }
61 }
62 return res;
63 }
64}

Callers 2

mainMethod · 0.95
mainMethod · 0.95

Calls 4

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

Tested by 2

mainMethod · 0.76
mainMethod · 0.76