Beispiel #1
0
 public StarTreeIndexNode getMatchingNode(StarTreeIndexNode node, List<Integer> dimensions) {
   if (node == null || node.isLeaf()) {
     return node;
   }
   Integer childDimensionName = node.getChildDimensionName();
   Integer childDimensionValue = dimensions.get(childDimensionName);
   StarTreeIndexNode child = node.getChildren().get(childDimensionValue);
   return getMatchingNode(child, dimensions);
 }
Beispiel #2
0
  public static void printTree(StarTreeIndexNode node, int level) {
    for (int i = 0; i < level; i++) {
      System.out.print("  ");
    }
    System.out.println(node);

    if (!node.isLeaf()) {
      for (StarTreeIndexNode child : node.getChildren().values()) {
        printTree(child, level + 1);
      }
    }
  }
Beispiel #3
0
 @Override
 public boolean equals(Object o) {
   if (!(o instanceof StarTreeIndexNode)) {
     return false;
   }
   StarTreeIndexNode n = (StarTreeIndexNode) o;
   return Objects.equal(nodeId, n.getNodeId())
       && Objects.equal(level, n.getLevel())
       && Objects.equal(dimensionName, n.getDimensionName())
       && Objects.equal(dimensionValue, n.getDimensionValue())
       && Objects.equal(childDimensionName, n.getChildDimensionName())
       && Objects.equal(children, n.getChildren())
       && Objects.equal(startDocumentId, n.getStartDocumentId())
       && Objects.equal(documentCount, n.getDocumentCount());
 }