namespace Org\Mxchange\CoreFramework\Filesystem\Index;
// Import framework stuff
-use Org\Mxchange\CoreFramework\Filesystem\Block;
use Org\Mxchange\CoreFramework\Filesystem\File\BaseBinaryFile;
+use Org\Mxchange\CoreFramework\Filesystem\Index\IndexableFile;
use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
+use Org\Mxchange\CoreFramework\Index\Stack\IndexableStack;
// Import SPL stuff
use \SplFileInfo;
* 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 IndexFile extends BaseBinaryFile implements Block {
+class IndexFile extends BaseBinaryFile implements IndexableFile {
/**
* Protected constructor
*
* Creates an instance of this File class and prepares it for usage
*
* @param $fileInfoInstance An instance of a SplFileInfo class
- * @param $blockInstance An instance of a Block class
- * @return $fileInstance An instance of this File class
+ * @param $indexInstance An instance of a IndexableStack class
+ * @return $indexFileInstance An instance of an IndexableFile class
*/
- public final static function createIndexFile (SplFileInfo $fileInfoInstance, Block $blockInstance) {
+ public final static function createIndexFile (SplFileInfo $fileInfoInstance, IndexableStack $indexInstance) {
// Get a new instance
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: fileInfoInstance[%s]=%s,blockInstance=%s - CALLED!', get_class($fileInfoInstance), $fileInfoInstance, $blockInstance->__toString()));
- $fileInstance = new IndexFile();
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: fileInfoInstance[%s]=%s,indexInstance=%s - CALLED!', get_class($fileInfoInstance), $fileInfoInstance, $indexInstance->__toString()));
+ $indexFileInstance = new IndexFile();
- // Set block instance here for callbacks
- $fileInstance->setBlockInstance($blockInstance);
+ // Set file instance here for callbacks
+ $indexFileInstance->setIndexableStackInstance($indexInstance);
// Expand file name with .idx
$indexInfoInstance = new SplFileInfo(sprintf('%s.idx', $fileInfoInstance->__toString()));
// Init this abstract file
- $fileInstance->initFile($indexInfoInstance);
+ $indexFileInstance->initFile($indexInfoInstance);
// Return the prepared instance
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: fileInstance=%s - EXIT!', $fileInstance->__toString()));
- return $fileInstance;
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: indexFileInstance=%s - EXIT!', $indexFileInstance->__toString()));
+ return $indexFileInstance;
}
/**