<commit_before>package krewfw.core {

    import krewfw.utils.as3.KrewObjectPool;
    import krewfw.utils.as3.KrewPoolable;

    /**
     * To make poolable actor, extends KrewPoolableActor and implements
     * in subclasses like this:
     *
     * <pre>
     * public class YourPoolableActorClass extends KrewPoolableActor {
     *
     *     private static var _objectPool:KrewObjectPool = new KrewObjectPool(YourPoolableActorClass);
     *
     *     protected override function onRecycle():void {
     *         _objectPool.recycle(this);
     *     }
     *
     *     public static function getObject(arg1:Number, arg2:uint):YourPoolableActorClass {
     *         var params:Object = {
     *             arg1: arg1,
     *             arg2: arg2
     *         };
     *         return _objectPool.getObject(params) as YourPoolableActorClass;
     *     }
     *
     *     public static function disposePool():void {
     *         _objectPool.dispose();
     *     }
     *
     *     ...
     * }
     * </pre>
     */
    //------------------------------------------------------------
    public class KrewPoolableActor extends KrewActor implements KrewPoolable {

        //------------------------------------------------------------
        /**
         * Poolable actor's constructor should be able to receive zero arguments
         * because KrewObjectPool instanciates it with no arguments.
         * You can init instance in onPooledObjectCreate() handler.
         */
        public function KrewPoolableActor() {
            poolable = true;
        }

        //------------------------------------------------------------
        // KrewPoolableActor's new init handlers
        //------------------------------------------------------------

        /** Called after init() */
        public function onPoolableInit(params:Object):void {
            // Override in subclasses
        }

        /** Called after init() and when actor comes back from pool. */
        public function onPoolableReinit(params:Object):void {
            // Override in subclasses
        }

        //------------------------------------------------------------
        // implementation of KrewPoolable
        // (No need to override)
        //------------------------------------------------------------

        public function onPooledObjectCreate(params:Object):void {
            addInitializer(function():void {
                onPoolableInit(params);
                onPoolableReinit(params);
            });
        }

        public function onPooledObjectInit(params:Object):void {}

        public function onRetrieveFromPool(params:Object):void {
            _retrieveFromPool();
            onPoolableReinit(params);
        }

        public function onPooledObjectRecycle():void {}

        public function onDisposeFromPool():void {
            _disposeFromPool();
        }

    }
}
<commit_msg>Modify comment<commit_after>package krewfw.core {

    import krewfw.utils.as3.KrewObjectPool;
    import krewfw.utils.as3.KrewPoolable;

    /**
     * To make poolable actor, extends KrewPoolableActor and implements
     * in subclasses like this:
     *
     * <pre>
     * public class YourPoolableActorClass extends KrewPoolableActor {
     *
     *     private static var _objectPool:KrewObjectPool = new KrewObjectPool(YourPoolableActorClass);
     *
     *     protected override function onRecycle():void {
     *         _objectPool.recycle(this);
     *     }
     *
     *     public static function getObject(arg1:Number, arg2:uint):YourPoolableActorClass {
     *         var params:Object = {
     *             arg1: arg1,
     *             arg2: arg2
     *         };
     *         return _objectPool.getObject(params) as YourPoolableActorClass;
     *     }
     *
     *     public static function disposePool():void {
     *         _objectPool.dispose();
     *     }
     *
     *     ...
     * }
     * </pre>
     */
    //------------------------------------------------------------
    public class KrewPoolableActor extends KrewActor implements KrewPoolable {

        //------------------------------------------------------------
        /**
         * Poolable actor's constructor should be able to receive zero arguments
         * because KrewObjectPool instanciates it with no arguments.
         * You can init instance in onPoolableInit() handler.
         */
        public function KrewPoolableActor() {
            poolable = true;
        }

        //------------------------------------------------------------
        // KrewPoolableActor's new init handlers
        //------------------------------------------------------------

        /** Called after init() */
        public function onPoolableInit(params:Object):void {
            // Override in subclasses
        }

        /** Called after init() and when actor comes back from pool. */
        public function onPoolableReinit(params:Object):void {
            // Override in subclasses
        }

        //------------------------------------------------------------
        // implementation of KrewPoolable
        // (No need to override)
        //------------------------------------------------------------

        public function onPooledObjectCreate(params:Object):void {
            addInitializer(function():void {
                onPoolableInit(params);
                onPoolableReinit(params);
            });
        }

        public function onPooledObjectInit(params:Object):void {}

        public function onRetrieveFromPool(params:Object):void {
            _retrieveFromPool();
            onPoolableReinit(params);
        }

        public function onPooledObjectRecycle():void {}

        public function onDisposeFromPool():void {
            _disposeFromPool();
        }

    }
}

{'fraction_non_alphanumeric': 0.20030816640986132, 'fraction_numerical': 0.002739256976545112, 'mean_word_length': 1.2873923257635083, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '521260', 'n_tokens_mistral': 1406, 'n_tokens_neox': 1361, 'n_words': 299}