// Load the file header
$this->readFileHeader();
-
- // Try to read file stack to speed up its processing.
- }
-
- /**
- * 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)
- *
- * @param $stackerName Name of the stack
- * @return $isInitialized Whether the stack is initialized
- */
- public function isStackInitialized ($stackerName) {
- // Is is there?
- $this->partialStub('stackerName=' . $stackerName);
- $isInitialized = TRUE;
-
- // Return result
- return $isInitialized;
- }
-
- /**
- * Getter for size of given stack (array count)
- *
- * @param $stackerName Name of the stack
- * @return $count Size of stack (array count)
- * @throws NoStackerException If given stack is missing
- */
- public function getStackCount ($stackerName) {
- // Is the stack not yet initialized?
- if (!$this->isStackInitialized($stackerName)) {
- // Throw an exception
- throw new NoStackerException(array($this, $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
- } // END - if
-
- // Now, count the array of entries
- $this->partialStub('stackerName=' . $stackerName);
- $count = 0;
-
- // Return result
- return $count;
}
/**
* @param $stackerName Name of the stack
* @param $value Value to add to this stacker
* @return void
- * @throws FullStackerException Thrown if the stack is full
*/
protected function addValue ($stackerName, $value) {
- // Is the stack not yet initialized or full?
- if (!$this->isStackInitialized($stackerName)) {
- // Then do it here
- $this->initStack($stackerName);
} elseif ($this->isStackFull($stackerName)) {
// Stacker is full
throw new FullStackerException(array($this, $stackerName, $value), self::EXCEPTION_STACKER_IS_FULL);
*
* @param $stackerName Name of the stack
* @return $value Value of last added value
- * @throws NoStackerException If the named stacker was not found
- * @throws EmptyStackerException If the named stacker is empty
*/
protected function getLastValue ($stackerName) {
// Is the stack not yet initialized or full?
- if (!$this->isStackInitialized($stackerName)) {
- // Throw an exception
- throw new NoStackerException(array($this, $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
} elseif ($this->isStackEmpty($stackerName)) {
// Throw an exception
throw new EmptyStackerException(array($this, $stackerName), self::EXCEPTION_STACKER_IS_EMPTY);
*
* @param $stackerName Name of the stack
* @return $value Value of last added value
- * @throws NoStackerException If the named stacker was not found
- * @throws EmptyStackerException If the named stacker is empty
*/
protected function getFirstValue ($stackerName) {
// Is the stack not yet initialized or full?
- if (!$this->isStackInitialized($stackerName)) {
- // Throw an exception
- throw new NoStackerException(array($this, $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
} elseif ($this->isStackEmpty($stackerName)) {
// Throw an exception
throw new EmptyStackerException(array($this, $stackerName), self::EXCEPTION_STACKER_IS_EMPTY);
*
* @param $stackerName Name of the stack
* @return $value Value "poped" from array
- * @throws NoStackerException If the named stacker was not found
- * @throws EmptyStackerException If the named stacker is empty
*/
protected function popLast ($stackerName) {
// Is the stack not yet initialized or full?
- if (!$this->isStackInitialized($stackerName)) {
- // Throw an exception
- throw new NoStackerException(array($this, $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
} elseif ($this->isStackEmpty($stackerName)) {
// Throw an exception
throw new EmptyStackerException(array($this, $stackerName), self::EXCEPTION_STACKER_IS_EMPTY);
*/
protected function popFirst ($stackerName) {
// Is the stack not yet initialized or full?
- if (!$this->isStackInitialized($stackerName)) {
- // Throw an exception
- throw new NoStackerException(array($this, $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
} elseif ($this->isStackEmpty($stackerName)) {
// Throw an exception
throw new EmptyStackerException(array($this, $stackerName), self::EXCEPTION_STACKER_IS_EMPTY);
$this->partialStub('stackerName=' . $stackerName);
return NULL;
}
+
+ /**
+ * Initializes given stacker
+ *
+ * @param $stackerName Name of the stack
+ * @param $forceReInit Force re-initialization
+ * @return void
+ * @throws UnsupportedOperationException This method is not (and maybe never will be) supported
+ */
+ public function initStack ($stackerName, $forceReInit = FALSE) {
+ throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
+ }
+
+ /**
+ * Initializes all stacks
+ *
+ * @return void
+ * @throws UnsupportedOperationException This method is not (and maybe never will be) supported
+ */
+ public function initStacks (array $stacks, $forceReInit = FALSE) {
+ throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
+ }
+
+ /**
+ * Checks whether the given stack is initialized (set in array $stackers)
+ *
+ * @param $stackerName Name of the stack
+ * @return $isInitialized Whether the stack is initialized
+ * @throws UnsupportedOperationException This method is not (and maybe never will be) supported
+ */
+ public function isStackInitialized ($stackerName) {
+ throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
+ }
+
+ /**
+ * Getter for size of given stack (array count)
+ *
+ * @param $stackerName Name of the stack
+ * @return $count Size of stack (array count)
+ */
+ public function getStackCount ($stackerName) {
+ // Now, count the array of entries
+ $this->partialStub('stackerName=' . $stackerName);
+ $count = 0;
+
+ // Return result
+ return $count;
+ }
+
+ /**
+ * Checks whether the given stack is empty
+ *
+ * @param $stackerName Name of the stack
+ * @return $isEmpty Whether the stack is empty
+ * @throws UnsupportedOperationException This method is not (and maybe never will be) supported
+ */
+ public final function isStackEmpty ($stackerName) {
+ throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
+ }
}
// [EOF]