示例#1
0
 private Map<String, Integer> getUniqueIds() {
   Map<String, Integer> result = new HashMap<String, Integer>();
   for (HeaderTableItem item : headerTableItems) {
     result.put(item.getItemId(), item.getNodeList().size());
   }
   return result;
 }
示例#2
0
 public List<UNode> getAllNodesOfHeaderTableItem(String id) {
   List<UNode> list = null;
   HeaderTableItem item = findHeaderTableItemById(id);
   if (item != null) {
     list = item.getNodeList();
   } else {
     list = Collections.emptyList();
   }
   return list;
 }
示例#3
0
 public void removeAllNodes(String id) {
   HeaderTableItem headerTableItem = getHeaderTableItem(id);
   List<UNode> nodeList = headerTableItem.getNodeList();
   headerTableItems.remove(headerTableItem);
   int count = nodeList.size();
   for (int i = 0; i < count; i++) {
     UNode childNode = nodeList.get(i);
     UNode parentNode = childNode.getParentNode();
     parentNode.getChildNodeList().remove(childNode);
   }
 }
示例#4
0
 public List<UNode> removeAndFindInfrequentNodesByMining(double minSupport) {
   List<UNode> nodes = new ArrayList<UNode>();
   int count = headerTableItems.size();
   for (int i = 0; i < count; i++) {
     HeaderTableItem item = headerTableItems.get(i);
     if (item.getMiningValue() < minSupport) {
       nodes.addAll(item.getNodeList());
       headerTableItems.remove(item);
       i--;
       count--;
     }
   }
   return nodes;
 }
示例#5
0
 public void slideHeaderTable() {
   for (HeaderTableItem item : headerTableItems) {
     List<UNode> nodes = item.getNodeList();
     int counter = nodes.size();
     for (int i = 0; i < counter; i++) {
       UNode node = nodes.get(i);
       boolean isEmpty = true;
       for (UData data : node.getUncertainDataList()) {
         if (data.getItemProbability() > 0) {
           isEmpty = false;
           break;
         }
       }
       if (isEmpty) {
         nodes.remove(node);
         counter = counter - 1;
         i--;
       }
     }
   }
 }