public void forAllComponents(ComponentVisitor visitor)
    {
        synchronized (mComponents)
        {
            for (GVRComponent comp : mComponents.values())
            {
                if (!visitor.visit(comp))
                {
                    return;
                }
            }
        }
        synchronized (mChildren)
        {
            for (int i = 0; i < mChildren.size(); ++i)
            {
                GVRSceneObject child = mChildren.get(i);
                child.forAllComponents(visitor);
            }
        }
    }
public void forAllComponents ( ComponentVisitor visitor ) { synchronized ( mComponents ) { for ( GVRComponent comp : mComponents . values ( ) ) { if ( ! visitor . visit ( comp ) ) { return ; } } } synchronized ( mChildren ) { for ( int i = 0 ; i < mChildren . size ( ) ; ++ i ) { GVRSceneObject child = mChildren . get ( i ) ; child . forAllComponents ( visitor ) ; } } }
Visits all the components attached to
the descendants of this scene object.
The ComponentVisitor.visit function is called for every
component of each descendant until it returns false.
This allows you to traverse the scene graph safely without copying it.
This method gives much better performance than iterating
children() or getChildren().

@param visitor ComponentVisitor interface implementing "visit" function

@see #children()
@see #getChildren()
@see SceneVisitor
@see #forAllDescendants(SceneVisitor)
@see #getComponent(long)