Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * The MIT License (MIT)
  * Copyright (c) 2014 Christian Gärtner
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
  * in the Software without restriction, including without limitation the rights
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
package org.achtern.AchternEngine.core.scenegraph.scanning;
DepthFirstTraversal Implementation of the SceneGraphWalker
public class DepthFirstWalker implements SceneGraphWalker {

List of all visitors
    @Getter protected List<Visitorvisitors;
    public DepthFirstWalker() {
         = new ArrayList<Visitor>();

Scans the given Node This should scan all child nodes. DepthFirst in this case

node Node to scan
    public void scan(Node node) {
        for (Visitor v : ) {
        for (Node n : node.getChildren().values()) {

Add a visitor, which should be called during the search.

visitor Visitor
    public void addVisitor(Visitor visitor) {

Remove all visitors from the SceneGraphWalker
    public void clearVisitors() {
New to GrepCode? Check out our FAQ X