public ObjectMap<String, Actor> getActorsMappedByIds(final boolean searchRecursively) {
        final ObjectMap<String, Actor> actorsByIds = new IgnoreCaseStringMap<Actor>();
        for (final Actor actor : actors) {
            final String id = LmlUtilities.getActorId(actor);
            if (id != null) {
                actorsByIds.put(id, actor);
            }
        }
        if (!searchRecursively) {
            return actorsByIds;
        }

        // Recursive ID search - need to scan all groups:
        final PooledList<Group> groupsToSearch = new PooledList<Group>();
        for (final Actor actor : actors) {
            if (actor instanceof Group) {
                groupsToSearch.add((Group) actor);
            }
        }
        while (!groupsToSearch.isEmpty()) {
            for (final Actor actor : groupsToSearch.removeFirst().getChildren()) {
                final String id = LmlUtilities.getActorId(actor);
                if (id != null) {
                    actorsByIds.put(id, actor);
                }
                if (actor instanceof Group) {
                    groupsToSearch.add((Group) actor);
                }
            }
        }
        return actorsByIds;
    }
public ObjectMap < String , Actor > getActorsMappedByIds ( final boolean searchRecursively ) { final ObjectMap < String , Actor > actorsByIds = new IgnoreCaseStringMap < Actor > ( ) ; for ( final Actor actor : actors ) { final String id = LmlUtilities . getActorId ( actor ) ; if ( id != null ) { actorsByIds . put ( id , actor ) ; } } if ( ! searchRecursively ) { return actorsByIds ; } final PooledList < Group > groupsToSearch = new PooledList < Group > ( ) ; for ( final Actor actor : actors ) { if ( actor instanceof Group ) { groupsToSearch . add ( ( Group ) actor ) ; } } while ( ! groupsToSearch . isEmpty ( ) ) { for ( final Actor actor : groupsToSearch . removeFirst ( ) . getChildren ( ) ) { final String id = LmlUtilities . getActorId ( actor ) ; if ( id != null ) { actorsByIds . put ( id , actor ) ; } if ( actor instanceof Group ) { groupsToSearch . add ( ( Group ) actor ) ; } } } return actorsByIds ; }
@param searchRecursively if true, any {@link Group} extending actors will also be searched through and any of
their children with IDs will be added to the map. Note that recursive search might be an expensive
operation and if you are sure that all actors with IDs (that you need) were _direct_ children of the
storage in LML, you should run this method with "false".
@return stored actors mapped by their IDs. Note that actors without IDs will be ignored and won't be added to the
map.