Package com.softwaremining.wrappers
Class AbstractSortBean
java.lang.Object
com.softwaremining.wrappers.CBLBean
com.softwaremining.wrappers.AbstractSortBean
- All Implemented Interfaces:
AbstractDataObject
,ICBLBeanNGroup
,ICBLContainer
,IFieldContainer
,ISMBean
,ISMDataType
Providing Sort Capabilities to DataBeans
-
Field Summary
Fields inherited from class com.softwaremining.wrappers.CBLBean
EBCDIC_JIT_PD_SUPPORT_FOR_SEQ_FILES, INDEX_FOR_NON_ARRAY_VERSION_OF_FIELD, INDEX_ZERO, log, tmp_lengthofAssignedValue, totalRuntime_allocate, totalRuntime_calcFieldOffsets, totalRuntime_getMemoryPosition, totalRuntime_setFieldFormatted
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addKeyAscending
(ISMObject field) void
addKeyAscending
(ISMObject[] fields) void
addKeyAscending
(String[] keyNames) void
addKeyDescending
(AbstractCBLField field) void
addKeyDescending
(ISMObject[] fields) void
addKeyDescending
(String[] keyNames) void
assignSortModeSize
(int size) Deprecated.- not needed or supportedvoid
assignStatus
(ISMObject status) void
assignStatusValue
(int value) Used internally to set the IO operation status-values.protected void
assignStatusValue
(String value) Method for assigning a string to the status.void
insert()
insert a record into the to-be-sorted-listboolean
isEof()
have we reached the end of the file ?void
load
(AbstractBasePersistence file) load a file for Sort Operationvoid
load a file for Merge operationvoid
merge()
Merge two or more files (See COBOL's MERGE statement)void
next()
void
void
release()
The release statement transfers records from the INPUT PROCEDURE to the input Phase of the sort operation.
Internally, it will call the InsertRecord() method for performing the transfer.void
The release statement transfers records from the INPUT PROCEDURE to the input Phase of the sort operation.
Internally, it will call the InsertRecord() method for performing the transfer.
The "xxxRecord" is generated by the translator when it expect there may be an Exception.abstract AbstractCBLField
int
Used internally to set the IO operation status-values.int
Used internally to set the IO operation status-values.void
save
(AbstractSequentialFile file) void
setAccessMode
(int value) void
setDuplicatesInOrder
(boolean duplicatesInOrder) Controls Sort of records with duplicate keys: Whether original order is maintained.void
setEbcdicSort
(boolean newValue) ===== WARNING ====>: Please note, DO NOT use when sorting Numeric VALUES In ASCII character '1' is before 'A', in EBCDIC it is the other way ('A' before '1') Setting EBCDIC Sort will convert all the values to EBCDIC before comparison (Hence lower performance).int
size()
have we reached the end of the file ?void
sort()
Sort data (See COBOL's SORT statement)Methods inherited from class com.softwaremining.wrappers.CBLBean
addCorrespondingValue, addCorrespondingValue, allocate, assignAddressTo, assignAddressTo, assignBean, assignBytesEncoded, assignCachedInitializationValue, assignCorrespondingValue, assignCorrespondingValue, assignDefaultValue, assignDependingField, assignEbcdicBytes, assignEbcdicJIT_PdSupportForSequentialFiles, assignEncodedValue, assignExemptFromMemRelease, assignExternal, assignHighValues, assignInternalVars, assignLowValues, assignRawEbcdicBytes, assignRecordSize, assignRedefines, assignRedefines, assignSessionId, assignStringFormatted, assignSubstring, assignSubstring, assignToAddressOf, assignToAddressOf, assignToAddressOf, assignToAddressOf, assignToAllFields, 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, printFieldPosition, printFieldValues, printOrderedFieldPosition, PrintOrderedFieldPositionsAndValue, releaseResources, releaseResources, resetCachedValues, resetCompressedFieldList, resetStructure, resize, retrieveActualLength, retrieveAsInt, retrieveAsString, retrieveCachedInitializationValue, retrieveCompressedFields, retrieveDependedFieldsList, retrieveEbcdicBytes, retrieveEbcdicValue, retrieveEncodedValue, retrieveField, retrieveField, retrieveFieldAtMemoryPosition, retrieveFieldFormatted, retrieveFields, retrieveIsTargetOfPointers, retrievePrimitiveFields, retrieveRawEbcdicBytes, retrieveSessionId, retrieveSQLObject, retrieveStorageCellSize, retrieveStorageChars, retrieveSubstring, retrieveSubstring, retrieveTopLevelField, retrieveValue, retrieveValue, setValue, stringValue, subtractCorrespondingValue, subtractCorrespondingValue, toString
-
Constructor Details
-
AbstractSortBean
public AbstractSortBean()for internal use only ... profiling information -
AbstractSortBean
-
-
Method Details
-
retrieveFirstLevelEntry
-
setAccessMode
public void setAccessMode(int value) -
setDuplicatesInOrder
public void setDuplicatesInOrder(boolean duplicatesInOrder) Controls Sort of records with duplicate keys: Whether original order is maintained. Defaults is to true- Parameters:
duplicatesInOrder
-
-
addKeyAscending
-
addKeyAscending
-
addKeyDescending
-
addKeyAscending
-
addKeyDescending
-
addKeyDescending
-
setEbcdicSort
public void setEbcdicSort(boolean newValue) ===== WARNING ====>: Please note, DO NOT use when sorting Numeric VALUES In ASCII character '1' is before 'A', in EBCDIC it is the other way ('A' before '1') Setting EBCDIC Sort will convert all the values to EBCDIC before comparison (Hence lower performance).- Parameters:
newValue
-
-
next
public void next() -
nextRecord
- Throws:
AtEndException
IOStatusException
-
isEof
have we reached the end of the file ?- Returns:
- Throws:
CBLException
-
size
public int size()have we reached the end of the file ?- Returns:
- Throws:
CBLException
-
release
public void release()The release statement transfers records from the INPUT PROCEDURE to the input Phase of the sort operation.
Internally, it will call the InsertRecord() method for performing the transfer. -
releaseRecord
public void releaseRecord()The release statement transfers records from the INPUT PROCEDURE to the input Phase of the sort operation.
Internally, it will call the InsertRecord() method for performing the transfer.
The "xxxRecord" is generated by the translator when it expect there may be an Exception. In this case, it doesn't apply. The method is here merely to provide consistency with Translator -
sort
public void sort()Sort data (See COBOL's SORT statement) -
merge
public void merge()Merge two or more files (See COBOL's MERGE statement) -
insert
public void insert()insert a record into the to-be-sorted-list -
assignStatus
-
assignStatusValue
public void assignStatusValue(int value) Used internally to set the IO operation status-values. Also if a FileStatus field is defined, the system will allocate correct values to it.- Parameters:
value
- - .. one of ACMBasePersistent.STATUS_xxxx
-
assignStatusValue
Method for assigning a string to the status. Note that in MicroFOcus, the LOCK status is represented bt "9D", ie the 2nd value is a String- Parameters:
value
-
-
retrieveStatusValue
public int retrieveStatusValue()Used internally to set the IO operation status-values. Also if a FileStatus field is defined, the system will allocate correct values to it.- Returns:
- - the status value .. one of ACMBasePersistent.STATUS_xxxx
-
retrieveSortResult
public int retrieveSortResult() -
retrieveStatusField
Used internally to set the IO operation status-values. -
assignSortModeSize
public void assignSortModeSize(int size) Deprecated.- not needed or supported -
loadForMerge
load a file for Merge operation- Parameters:
file
-- Throws:
CBLException
-
load
load a file for Sort Operation- Parameters:
file
-- Throws:
CBLException
-
save
- Throws:
CBLException
-