Ejemplo n.º 1
0
    public boolean hasNext() {
      if (_tree == null || !_tree.inPagingMold()) return _it.hasNext();

      Integer renderedCount = (Integer) _tree.getAttribute(Attributes.RENDERED_ITEM_COUNT);
      if (renderedCount == null || renderedCount.intValue() < _tree.getPaginal().getPageSize())
        return _it.hasNext();
      return false;
    }
Ejemplo n.º 2
0
 /** 将决策树输出到标准输出 */
 static void outputDecisionTree(Object obj, int level, Object from) {
   for (int i = 0; i < level; i++) System.out.print("|-----");
   if (from != null) System.out.printf("(%s):", from);
   if (obj instanceof Tree) {
     Tree tree = (Tree) obj;
     String attrName = tree.getAttribute();
     System.out.printf("[%s = ?]\n", attrName);
     for (Object attrValue : tree.getAttributeValues()) {
       Object child = tree.getChild(attrValue);
       outputDecisionTree(child, level + 1, attrName + " = " + attrValue);
     }
   } else {
     System.out.printf("[CATEGORY = %s]\n", obj);
   }
 }
Ejemplo n.º 3
0
 @Override
 public Object getAttribute(String name) {
   return source.getAttribute(name);
 }