예제 #1
0
 public HeaderTable copy() {
   HeaderTable headerTable = new HeaderTable(windowSize);
   Map<String, Integer> ids = getUniqueIds();
   Iterator iterator = ids.entrySet().iterator();
   while (iterator.hasNext()) {
     Map.Entry pair = (Map.Entry) iterator.next();
     String id = (String) pair.getKey();
     int totalNode = (Integer) pair.getValue();
     headerTable.addNewTableItem(id, totalNode);
   }
   return headerTable;
 }
예제 #2
0
 public HeaderTable copy(UNode uNode) {
   HeaderTable newTable = new HeaderTable(windowSize);
   List<UNode> distinctNodes = uNode.getDistinctNodes();
   for (HeaderTableItem item : this.headerTableItems) {
     HeaderTableItem newTableItem = newTable.addNewTableItem(item.getItemId());
     newTableItem.addProbabilityAndPrefixValue(
         item.getTotalProbability(), item.getTotalPrefixValue());
   }
   for (UNode node : distinctNodes) {
     newTable.updateHeaderTable(node, 0, 0);
   }
   return newTable;
 }