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; }
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; }
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); } }
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; }
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--; } } } }