Package com.softwaremining.files
Class CachedIndexedFile
- All Implemented Interfaces:
IPersistence,AbstractDataObject,ICBLBeanNGroup,ICBLContainer,IFieldContainer,ISMBean,ISMDataType
Cached table is for Reference Data only.
Reference data are NOT written back to the file-system, they are only used in read-only mode.
The data is loaded from file-system (when open() method is called) - and loaded into memory.
To use - find a persistent class which inherits from SQLWrapper or AbstractORContainer , and change its superclass to CachedIndexedFile.
also remember to use "assignFileName" to define the file containing the data.
To use - find a persistent class which inherits from SQLWrapper or AbstractORContainer , and change its superclass to CachedIndexedFile.
also remember to use "assignFileName" to define the file containing the data.
-
Field Summary
FieldsFields inherited from class com.softwaremining.files.SequentialNIOFile
_recordSize, fileInputStream, fileOutputStream, ONE_ByteBuffer, PAGE_ByteBuffer, SPACE_ByteBuffer, useMultiByteReaderFields inherited from class com.softwaremining.files.AbstractSequentialFile
ADVANCE_NOT_INITIALIZED, advanceContinuation, advanceSize, advanceType, CRLFcharCount, currentRecordNumber, EJECT, FIRST_LINE_POS, firstLineTerminators, firstRead, fixedLenghtRecordsEndWithNewLine, fixedLengthRecord, justRead, LINE, lineCounter, numberOfInitialRecords, PAGE, rdw_format, RDW_LENGTH, rdw_Null, recordDependingField, targetIsPrinter, TOP_OF_PAGE, totalRuntime, useRDWFields inherited from class com.softwaremining.files.AbstractFile
openModeFields inherited from class com.softwaremining.wrappers.AbstractBasePersistence
fileName, ownerClassName, statusFields inherited from class com.softwaremining.wrappers.CBLBean
EBCDIC_JIT_PD_SUPPORT_FOR_SEQ_FILES, INDEX_FOR_NON_ARRAY_VERSION_OF_FIELD, INDEX_ZERO, tmp_lengthofAssignedValue, totalRuntime_allocate, totalRuntime_calcFieldOffsets, totalRuntime_getMemoryPosition, totalRuntime_setFieldFormattedFields inherited from interface com.softwaremining.sql.IPersistence
ACCESS_MODE_DYNAMIC, ACCESS_MODE_RANDOM, ACCESS_MODE_SEQUENTIAL, ASCENDING_RECORD_KEY, CONDITION_TYPE_EQUALS, CONDITION_TYPE_GREATER, CONDITION_TYPE_GREATER_OR_EQUALS, CONDITION_TYPE_IGNORE, CONDITION_TYPE_IGNORE_FOR_SQL_LIKE, CONDITION_TYPE_LESS, CONDITION_TYPE_LESS_OR_EQUALS, CONDITION_TYPE_LIKE, CONDITION_TYPE_NO_CONDITION, CONDITION_TYPE_NOT_ASSIGNED, DESCENDING_RECORD_KEY, OPEN_MODE_EXTEND, OPEN_MODE_I_O, OPEN_MODE_INPUT, OPEN_MODE_NOT_OPENED, OPEN_MODE_OUTPUT, STATUS_AT_END, STATUS_CLOSE_FILE_FILE_NOT_OPEN, STATUS_DUP_KEY, STATUS_FAILED_CLOSING, STATUS_INCORRECT_READ_OF_UNOPENED_FILE, STATUS_INCORRECT_RECORDSIZE_REWRITE, STATUS_INSERT_ERR_INAPPROPRIATE_FILE, STATUS_INSERT_ERR_INVALID_KEY, STATUS_LOCK, STATUS_NOT_FOUND, STATUS_OPEN_FILE_FILE_NOT_FOUND, STATUS_REWRITE_WITHOUT_READ, STATUS_SM_FAIL_UNKOWN_REASON, STATUS_SM_NOT_ASSIGNED, STATUS_SUCCESS, UNCERTAIN_OF_RETURN_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassignRecordKey(ISMObject recordKey) intclear()NOT SUPPORTED - this is a read-only data cacheintclose()Close file and change status to STATUS_SUCCEED.intdelete()NOT SUPPORTED - this is a read-only data cachevoidfirst()Goto first record (as organized by key's)intNOT SUPPORTED - this is a read-only data cachevoidlast()Goto last record (as organized by key's)intread next recordintopen(int openMode) Opens and reads all the information into memory (if not there already)intread previous recordintread()Read record which matches record-keyintreadAtPosition(int position) goto the said "position", and read the datafor internal use only
Native Keys refer to either a.for internal use onlyintFind the record identified by keyfinal intseekRecord(ISMObject key) Go to the record identified by keyintseekRecord(ISMObject[] keys, int conditionType) Find the record identified by keyintsize()intupdate()NOT SUPPORTED - this is a read-only data cacheMethods inherited from class com.softwaremining.files.SequentialNIOFile
_insertRecord, assignUseMultiByteReader, getReadSize, insertNewLine, isFileOpened, nextWithException_UseExactRecordLenght, nextWithException_UseExactRecordLenght_UsingFileChannel, nextWithException_UseExactRecordLenght_UsingFileReader, nextWithException_UseLineBreaks, open, prevWithException, readLine_FromFileChannel, readLine_FromFileReader, updateRecordMethods inherited from class com.softwaremining.files.AbstractSequentialFile
advance, advance, advance, assignDependingField, assignEncodedBytes, assignFileName, assignFixedLenghtRecordsEndWithNewLine, assignRecordsAreFixedLength, assignRecordSize, assignTargetIsPrinter, assignUsesRDW, closeReel, deleteRecord, exists, getCRLFcharCount, getRecordSize, insert, insertRecord, isFixedLenghtRecordsEndWithNewLine, isRDW, println, readRecord, retrieveCurrentRecordNumber, retrieveEncodedBytesForWrite, retrieveFieldLineCounter, retrieveFieldPageCounter, retrieveLineCounter, retrieveNumberOfInitialRecords, retrievePageCounter, retrieveRecordDependingField, setCRLFcharCountMethods inherited from class com.softwaremining.files.AbstractFile
assignOptional, resetDataDirectory, retrieveDataDirectory, retrieveFullFileName, retrieveOpenModeMethods inherited from class com.softwaremining.wrappers.AbstractBasePersistence
assignAccessMode, assignLock, assignStatus, assignStatus, assignStatusAsPrimitive, assignStatusValue, assignStatusValue, assignTableName, insert, next, prev, readRow, retrieveAccessMode, retrieveFileName, retrieveFileName, retrieveFirstLevelEntry, retrieveSessionId, retrieveStatusField, retrieveStatusValueMethods inherited from class com.softwaremining.wrappers.CBLBean
addCorrespondingValue, addCorrespondingValue, allocate, assignAddressTo, assignAddressTo, assignBean, assignBytesEncoded, assignCachedInitializationValue, assignCorrespondingValue, assignCorrespondingValue, assignDefaultValue, assignEbcdicBytes, assignEbcdicJIT_PdSupportForSequentialFiles, assignEncodedValue, assignExemptFromMemRelease, assignExternal, assignHighValues, assignInternalVars, assignLowValues, assignRawEbcdicBytes, assignRedefines, assignRedefines, assignSessionId, assignStringFormatted, assignSubstring, assignSubstring, assignToAddressOf, assignToAddressOf, assignToAddressOf, assignToAddressOf, assignToAllFields, assignValue, assignValue, assignValue, assignValue, assignValue, assignValue, assignValue, assignValue, calculateStorageSize, containsPointers, equals, equals, equals, equals, equalsRightTrimmed, fieldsCount, fill, fill, fill, fill, fill, getValue, hasPackedDecimalFields, initDefaultValues, initialize, initialize, isExemptFromMemRelease, isFilled, isFilled, isFilled, isFilled, isGreaterThan, isGreaterThan, isGreaterThan, isHighValues, isInvolvedInDependency, isInvolvedInExternalDependency, isLessOrEqualTo, isLessOrEqualTo, isLessOrEqualTo, isLessOrEqualTo, isLessOrEqualTo, isLessThan, isLessThan, isLessThan, isLessThan, isLessThan, isLowValues, isRedefinedByAnotherClass, isResourceAlreadyReleased, lengthOf, print, printFieldPosition, printFieldValues, printOrderedFieldPosition, releaseResources, releaseResources, resetCachedValues, resetCompressedFieldList, resetStorageManager, resetStructure, resize, retrieveActualLength, retrieveAsInt, retrieveAsString, retrieveCachedInitializationValue, retrieveCompressedFields, retrieveDependedFieldsList, retrieveEbcdicBytes, retrieveEbcdicValue, retrieveEncodedValue, retrieveField, retrieveField, retrieveFieldAtMemoryPosition, retrieveFieldFormatted, retrieveFields, retrieveIsTargetOfPointers, retrievePrimitiveFields, retrieveRawEbcdicBytes, retrieveRedefinesList, retrieveSQLObject, retrieveStorageBytes, retrieveStorageCellSize, retrieveSubstring, retrieveSubstring, retrieveTopLevelField, retrieveValue, retrieveValue, setValue, stringValue, subtractCorrespondingValue, subtractCorrespondingValue, toString
-
Field Details
-
nativeKeys
-
-
Constructor Details
-
CachedIndexedFile
public CachedIndexedFile()constructor -
CachedIndexedFile
Constructor -- Parameters:
owner-
-
-
Method Details
-
assignRecordKey
-
retrieveNativeKeys
for internal use only
Native Keys refer to either a. any keys set by setRecordKey b. in absence of any keys defined by setRecordKey, then an additional index keys is created by SoftwareMining framework. (This is usually called INDX_FLD_0;) -
retrieveRecordKey
for internal use only- Returns:
-
open
Opens and reads all the information into memory (if not there already)- Overrides:
openin classSequentialNIOFile- Parameters:
openMode- refers to:
IPersistence.OPEN_MODE_INPUT ( read )
IPersistence.OPEN_MODE_OUTPUT (Write)
IPersistence.OPEN_MODE_I_O (read-write)
IPersistence.OPEN_MODE_EXTEND: (read-write)- Throws:
IOCriticalException
-
close
Description copied from class:SequentialNIOFileClose file and change status to STATUS_SUCCEED.- Overrides:
closein classSequentialNIOFile- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOCriticalException
-
seekRecord
Find the record identified by key -
seek
Find the record identified by key -
seekRecord
Go to the record identified by key -
read
Read record which matches record-key- Overrides:
readin classAbstractSequentialFile- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
nextRecord
read next record- Overrides:
nextRecordin classAbstractSequentialFile- Returns:
- Throws:
IOStatusException
-
readAtPosition
goto the said "position", and read the data- Parameters:
position-- Returns:
- Throws:
IOStatusException
-
prevRecord
read previous record- Overrides:
prevRecordin classAbstractSequentialFile- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
first
Goto first record (as organized by key's)- Throws:
IOStatusException
-
last
Goto last record (as organized by key's)- Throws:
IOStatusException
-
size
public int size() -
update
NOT SUPPORTED - this is a read-only data cache- Overrides:
updatein classAbstractBasePersistence- Throws:
IOStatusException
-
insertRecord
NOT SUPPORTED - this is a read-only data cache- Overrides:
insertRecordin classAbstractSequentialFile- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-
delete
NOT SUPPORTED - this is a read-only data cache- Overrides:
deletein classAbstractBasePersistence- Throws:
IOStatusException
-
clear
NOT SUPPORTED - this is a read-only data cache- Overrides:
clearin classSequentialNIOFile- Returns:
- when successful it returns IPersistence.STATUS_SUCCESS
- Throws:
IOStatusException
-