}
/**
- * Initializes this stack.
+ * Initializes this file-based stack.
*
* @param $fileName File name of this stack
* @return void
*/
- protected function initStack ($fileName) {
+ protected function initFileStack ($fileName) {
// Get a file i/o pointer instance
$pointerInstance = ObjectFactory::createObjectByConfiguredName('file_raw_input_output_class', array($fileName));
$this->setIteratorInstance($iteratorInstance);
}
+ /**
+ * Initializes given stacker
+ *
+ * @param $stackerName Name of the stack
+ * @param $forceReInit Force re-initialization
+ * @return void
+ * @throws AlreadyInitializedStackerException If the stack is already initialized
+ */
+ public function initStack ($stackerName, $forceReInit = FALSE) {
+ // Is the stack already initialized?
+ if (($forceReInit === FALSE) && ($this->isStackInitialized($stackerName))) {
+ // Then throw the exception
+ throw new AlreadyInitializedStackerException(array($this, $stackerName, $forceReInit), self::EXCEPTION_STACKER_ALREADY_INITIALIZED);
+ } // END - if
+
+ // Initialize the given stack
+ $this->partialStub('stackerName=' . $stackerName . ',forceReInit=' . intval($forceReInit));
+ }
+
/**
* Checks whether the given stack is initialized (set in array $stackers)
*