]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/index/class_BaseIndex.php
Continued:
[core.git] / framework / main / classes / index / class_BaseIndex.php
index d035d61766a4b2a324f5bfd679a70f3eff7f5691..47a6f715a6118a7d93cab5a7ffc0459cba7b7f2b 100644 (file)
@@ -1,11 +1,13 @@
 <?php
 // Own namespace
-namespace CoreFramework\Index;
+namespace Org\Mxchange\CoreFramework\Index;
 
 // Import framework stuff
-use CoreFramework\Factory\ObjectFactory;
-use CoreFramework\Filesystem\File\BaseBinaryFile;
-use CoreFramework\Object\BaseFrameworkSystem;
+use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Filesystem\File\BaseBinaryFile;
+use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
+use Org\Mxchange\CoreFramework\Iterator\Filesystem\SeekableWritableFileIterator;
+use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
 /**
  * A general index class
@@ -29,7 +31,7 @@ use CoreFramework\Object\BaseFrameworkSystem;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class BaseIndex extends BaseFrameworkSystem {
+abstract class BaseIndex extends BaseFrameworkSystem {
        /**
         * Magic for this index
         */
@@ -103,7 +105,7 @@ class BaseIndex extends BaseFrameworkSystem {
                $this->getIteratorInstance()->setHeader($header);
 
                // Check if the array has only 3 elements
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] header(%d)=%s', __METHOD__, __LINE__, count($header), print_r($header, TRUE)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] header(%d)=%s', __METHOD__, __LINE__, count($header), print_r($header, true)));
                assert(count($header) == 2);
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__));
 
@@ -145,7 +147,7 @@ class BaseIndex extends BaseFrameworkSystem {
                );
 
                // Write it to disk (header is always at seek position 0)
-               $this->getIteratorInstance()->writeData(0, $header, FALSE);
+               $this->getIteratorInstance()->writeData(0, $header, false);
 
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__));
        }
@@ -223,16 +225,6 @@ class BaseIndex extends BaseFrameworkSystem {
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
-       /**
-        * Getter for file name
-        *
-        * @return      $fileName       The current file name
-        * @throws      UnsupportedOperationException   If this method is called
-        */
-       public function getFileName () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
-       }
-
        /**
         * Initializes counter for valid entries, arrays for damaged entries and
         * an array for gap seek positions. If you call this method on your own,
@@ -327,7 +319,7 @@ class BaseIndex extends BaseFrameworkSystem {
         * @return      void
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
-       public function writeData ($seekPosition, $data, $flushHeader = TRUE) {
+       public function writeData ($seekPosition, $data, $flushHeader = true) {
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s,data[]=%s,flushHeader=%d', __METHOD__, __LINE__, $seekPosition, gettype($data), intval($flushHeader)));
                throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
@@ -341,7 +333,7 @@ class BaseIndex extends BaseFrameworkSystem {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function writeValueToFile ($groupId, $value) {
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',value[' . gettype($value) . ']=' . print_r($value, TRUE));
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',value[' . gettype($value) . ']=' . print_r($value, true));
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }