Class RatHelper

  • All Implemented Interfaces:
    adams.core.logging.LoggingSupporter, adams.core.SizeOfHandler, Serializable

    public class RatHelper
    extends adams.core.logging.LoggingObject
    Helper class for Rat actors.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Constructor Summary

      Constructors 
      Constructor Description
      RatHelper()  
    • Constructor Detail

      • RatHelper

        public RatHelper()
    • Method Detail

      • findRat

        public adams.flow.core.Actor findRat​(adams.flow.core.ActorHandler group,
                                             RatReference name)
        Checks a control actor's children whether they contain the rat that we're looking for.
        Parameters:
        group - the group to check
        name - the name of the rat
        Returns:
        the rat or null if not found
      • findRat

        public adams.flow.core.Actor findRat​(adams.flow.core.Actor root,
                                             RatReference name)
        Tries to find the rat referenced by its name.
        Parameters:
        root - the root to search in
        name - the name of the rat
        Returns:
        the rat or null if not found
      • findRatRecursive

        public adams.flow.core.Actor findRatRecursive​(adams.flow.core.Actor actor,
                                                      RatReference name)
        Tries to find the referenced rat. First all possible actor handlers are located recursively (up to the root) that allow also singletons. This list of actors is then searched for the rat.
        Parameters:
        actor - the actor to start from
        name - the name of the rat
        Returns:
        the rat or null if not found
        See Also:
        ActorUtils.findActorHandlers(Actor, boolean)
      • findAllRats

        public static List<adams.flow.core.Actor> findAllRats​(adams.flow.core.Actor flow)
        Returns all Rats instances that can be located in the flow
        Parameters:
        flow - the flow to use
        Returns:
        the Rats instances