/** @deprecated */ public static List<ParseTree> descendants(ParseTree t) { return getDescendants(t); }
@Override public Collection<ParseTree> evaluate(ParseTree t) { if ( invert ) return new ArrayList<ParseTree>(); // !* is weird but valid (empty) return Trees.getDescendants(t); } }
/** Get all descendents; includes t itself. * * @since 4.5.1 */ public static List<ParseTree> getDescendants(ParseTree t) { List<ParseTree> nodes = new ArrayList<ParseTree>(); nodes.add(t); int n = t.getChildCount(); for (int i = 0 ; i < n ; i++){ nodes.addAll(getDescendants(t.getChild(i))); } return nodes; }
/** @deprecated */ public static List<ParseTree> descendants(ParseTree t) { return getDescendants(t); }
/** @deprecated */ public static List<ParseTree> descendants(ParseTree t) { return getDescendants(t); }
/** @deprecated */ @Deprecated public static List<ParseTree> descendants(ParseTree t) { return getDescendants(t); }
@Override public Collection<ParseTree> evaluate(ParseTree t) { if ( invert ) return new ArrayList<ParseTree>(); // !* is weird but valid (empty) return Trees.getDescendants(t); } }
@Override public Collection<ParseTree> evaluate(ParseTree t) { if ( invert ) return new ArrayList<ParseTree>(); // !* is weird but valid (empty) return Trees.getDescendants(t); } }
@Override public Collection<ParseTree> evaluate(ParseTree t) { if ( invert ) return new ArrayList<ParseTree>(); // !* is weird but valid (empty) return Trees.getDescendants(t); } }
/** Get all descendents; includes t itself. * * @since 4.5.1 */ public static List<ParseTree> getDescendants(ParseTree t) { List<ParseTree> nodes = new ArrayList<ParseTree>(); nodes.add(t); int n = t.getChildCount(); for (int i = 0 ; i < n ; i++){ nodes.addAll(getDescendants(t.getChild(i))); } return nodes; }
/** Get all descendents; includes t itself. * * @since 4.5.1 */ public static List<ParseTree> getDescendants(ParseTree t) { List<ParseTree> nodes = new ArrayList<ParseTree>(); nodes.add(t); int n = t.getChildCount(); for (int i = 0 ; i < n ; i++){ nodes.addAll(getDescendants(t.getChild(i))); } return nodes; }
/** Get all descendents; includes t itself. * * @since 4.5.1 */ public static List<ParseTree> getDescendants(ParseTree t) { List<ParseTree> nodes = new ArrayList<ParseTree>(); nodes.add(t); int n = t.getChildCount(); for (int i = 0 ; i < n ; i++){ nodes.addAll(getDescendants(t.getChild(i))); } return nodes; }