/** * Test whether the input i is unique; * if not, insert into the hash table and return false * otherwise, return true */ public boolean isUnique(int i){ int temp = i & mask1; if (temp>maxDepth){ maxDepth = temp; } if (storage[temp]==null) { storage[temp]= new FastIntBuffer(pageSizeE); storage[temp].append(i); return true; } else{ int size = storage[temp].size(); for (int j=0;j<size;j++){ if (i == storage[temp].intAt(j)){ return false; } } storage[temp].append(i); return true; } }
/** * Clear will erase all the nodes, internal buffers are reused * */ public void clear() { size = position = count = 0; fib.clear(); }
if (count<fib.size()) { i = fib.intAt(count); boolean b = (i >= 0); if (b == false) { if (b==false){ vn.atTerminal = true; vn.LN = fib.intAt(count+1); count+=2; }else{ vn.context[1]=fib.intAt(count+1); vn.l1index = fib.intAt(count+2); if (b==false){ vn.atTerminal = true; vn.LN = fib.intAt(count+3); count+=4; }else{ vn.context[1]=fib.intAt(count+1); vn.context[2]=fib.intAt(count+2); vn.l1index = fib.intAt(count+3); vn.l2lower = fib.intAt(count+4); vn.l2upper = fib.intAt(count+5); vn.l2index = fib.intAt(count+6); if (b==false){ vn.atTerminal = true; vn.LN = fib.intAt(count+7); count+=8;
throw new NavExceptionHuge("getElementFragmentNS can only be called when parsing is ns enabled"); FastIntBuffer fib = new FastIntBuffer(3); // init size 8 if (type==VTDNavHuge.TOKEN_ATTR_NAME || type==VTDNavHuge.TOKEN_ATTR_NS){ if (type == VTDNavHuge.TOKEN_ATTR_NS){ fib.append(k); count = fib.size(); d--; while (d >= 0) { boolean unique = true; if (type == VTDNavHuge.TOKEN_ATTR_NS) { for (int z = 0; z < fib.size(); z++) { if (matchTokens(fib.intAt(z), this, k)) { unique = false; break; fib.append(k); int newSz= fib.size()-count; for (i= 0; i<newSz; i++ ){ fib.modifyEntry(i,fib.intAt(i+count)); fib.resize(newSz);
ia[k]= k; FastIntBuffer fib = new FastIntBuffer(13); fib.append(ia); fib.clear(); fib.append(ia); int ib[] = fib.toIntArray();
/** * The parameter-less constructor * */ public NodeRecorderHuge() { vn = null; size = position = 0; fib = new FastIntBuffer(BUF_SZ_EXPO); }
/** * Get the int at the location specified by index. * @return int * @param index int */ public int intAt(int index) { if (index < 0 || index > size()-1) { throw new IndexOutOfBoundsException(); } // int pageNum = (int) index / pageSize; int pageNum = index>>exp; //System.out.println("page Number is "+pageNum); // int offset = index % pageSize; int offset = index & r; return ((int[]) bufferArrayList.get(pageNum))[offset]; } /**
/** * This is for debugging purpose * @param fib */ public void sampleState(FastIntBuffer fib){ // for(int i=0;i<context.) // context[i] = -1; // fib.append(context); if (context[0]>=1) fib.append(l1index); if (context[0]>=2){ fib.append(l2index); fib.append(l2lower); fib.append(l2upper); } if (context[0]>=3){ fib.append(l3index); fib.append(l3lower); fib.append(l3upper); } }
throw new NavExceptionHuge("getElementFragmentNS can only be called when parsing is ns enabled"); FastIntBuffer fib = new FastIntBuffer(3); // init size 8 if (type==VTDNavHuge.TOKEN_ATTR_NAME || type==VTDNavHuge.TOKEN_ATTR_NS) if (type == VTDNavHuge.TOKEN_ATTR_NS){ fib.append(k); count = fib.size(); d--; while (d >= 0) { boolean unique = true; if (type == VTDNavHuge.TOKEN_ATTR_NS) { for (int z = 0; z < fib.size(); z++) { if (matchTokens(fib.intAt(z), this, k)) { unique = false; break; fib.append(k); int newSz= fib.size()-count; for (i= 0; i<newSz; i++ ){ fib.modifyEntry(i,fib.intAt(i+count)); fib.resize(newSz);
ia[k]= k; FastIntBuffer fib = new FastIntBuffer(13); fib.append(ia); fib.clear(); fib.append(ia); int ib[] = fib.toIntArray();
if (count<fib.size()) { i = fib.intAt(count); boolean b = (i >= 0); if (b == false) { if (b==false){ vn.atTerminal = true; vn.LN = fib.intAt(count+1); count+=2; }else{ vn.context[1]=fib.intAt(count+1); vn.l1index = fib.intAt(count+2); if (b==false){ vn.atTerminal = true; vn.LN = fib.intAt(count+3); count+=4; }else{ vn.context[1]=fib.intAt(count+1); vn.context[2]=fib.intAt(count+2); vn.l1index = fib.intAt(count+3); vn.l2lower = fib.intAt(count+4); vn.l2upper = fib.intAt(count+5); vn.l2index = fib.intAt(count+6); if (b==false){ vn.atTerminal = true; vn.LN = fib.intAt(count+7); count+=8;
/** * The parameter-less constructor * */ public NodeRecorderHuge() { vn = null; size = position = 0; fib = new FastIntBuffer(BUF_SZ_EXPO); }
/** * Get the int at the location specified by index. * @return int * @param index int */ public int intAt(int index) { if (index < 0 || index > size()-1) { throw new IndexOutOfBoundsException(); } // int pageNum = (int) index / pageSize; int pageNum = index>>exp; //System.out.println("page Number is "+pageNum); // int offset = index % pageSize; int offset = index & r; return ((int[]) bufferArrayList.get(pageNum))[offset]; } /**
/** * This is for debugging purpose * @param fib */ public void sampleState(FastIntBuffer fib){ // for(int i=0;i<context.) // context[i] = -1; // fib.append(context); if (context[0]>=1) fib.append(l1index); if (context[0]>=2){ fib.append(l2index); fib.append(l2lower); fib.append(l2upper); } if (context[0]>=3){ fib.append(l3index); fib.append(l3lower); fib.append(l3upper); } }
/** * Test whether the input i is unique; * if not, insert into the hash table and return false * otherwise, return true */ public boolean isUnique(int i){ int temp = i & mask1; if (temp>maxDepth){ maxDepth = temp; } if (storage[temp]==null) { storage[temp]= new FastIntBuffer(pageSizeE); storage[temp].append(i); return true; } else{ int size = storage[temp].size(); for (int j=0;j<size;j++){ if (i == storage[temp].intAt(j)){ return false; } } storage[temp].append(i); return true; } }
throw new NavExceptionHuge("getElementFragmentNS can only be called when parsing is ns enabled"); FastIntBuffer fib = new FastIntBuffer(3); // init size 8 if (type==VTDNavHuge.TOKEN_ATTR_NAME || type==VTDNavHuge.TOKEN_ATTR_NS) if (type == VTDNavHuge.TOKEN_ATTR_NS){ fib.append(k); count = fib.size(); d--; while (d >= 0) { boolean unique = true; if (type == VTDNavHuge.TOKEN_ATTR_NS) { for (int z = 0; z < fib.size(); z++) { if (matchTokens(fib.intAt(z), this, k)) { unique = false; break; fib.append(k); int newSz= fib.size()-count; for (i= 0; i<newSz; i++ ){ fib.modifyEntry(i,fib.intAt(i+count)); fib.resize(newSz);
ia[k]= k; FastIntBuffer fib = new FastIntBuffer(13); fib.append(ia); fib.clear(); fib.append(ia); int ib[] = fib.toIntArray();
if (count<fib.size()) { i = fib.intAt(count); boolean b = (i >= 0); if (b == false) { if (b==false){ vn.atTerminal = true; vn.LN = fib.intAt(count+1); count+=2; }else{ vn.context[1]=fib.intAt(count+1); vn.l1index = fib.intAt(count+2); if (b==false){ vn.atTerminal = true; vn.LN = fib.intAt(count+3); count+=4; }else{ vn.context[1]=fib.intAt(count+1); vn.context[2]=fib.intAt(count+2); vn.l1index = fib.intAt(count+3); vn.l2lower = fib.intAt(count+4); vn.l2upper = fib.intAt(count+5); vn.l2index = fib.intAt(count+6); if (b==false){ vn.atTerminal = true; vn.LN = fib.intAt(count+7); count+=8;