Package com.softwaremining.util
Class SortManager
java.lang.Object
com.softwaremining.util.SortManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanprotected static Logstatic longfor internal use only ... -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAppend all elements to the sortvoidaddKeyAscending(ISMObject field) voidaddKeyAscending(ISMObject[] fields) voidaddKeyAscending(String[] keyNames) voidaddKeyDescending(ISMObject field) voidaddKeyDescending(ISMObject[] fields) voidaddKeyDescending(String[] keyNames) voidclear()Clear all rowsget(int i) getKeys()static intvoidinsert()automaticaly adds the stringified value of the sortFile (sortField was passed to SortManager constructor)voidAlso add the new value to the sortField (sortField was passed to SortManager constructor)booleanisEof()have we reached the end of the file ?next()voidremove(int index) voidsetDuplicatesInOrder(boolean duplicatesInOrder) Controls Sort of records with duplicate keys: Whether original order is maintained.voidsetEbcdicSort(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).voidsetSortField(ICBLDataType newSortField) static voidsetSortResult(int sortResult) intsize()have we reached the end of the file ?intsort()intsort(boolean onFailThrowException) voidsortArray(AbstractCBLField arrayField)
-
Field Details
-
log
-
DEBUG
public static final boolean DEBUG- See Also:
-
totalRuntime
public static long totalRuntimefor internal use only ... profiling information
-
-
Constructor Details
-
SortManager
-
-
Method Details
-
getWrapper
-
getKeys
-
getTopLevelSortField
-
setSortField
-
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-
-
sortArray
-
sort
public int sort() -
sort
public int sort(boolean onFailThrowException) - Returns:
- int - 0 is success, 16 is failure designed to return a value indicating whether sort is successful or not. For documentation please see: http://publib.boulder.ibm.com/infocenter/iadthelp/v7r0/index.jsp?topic=/com.ibm.etools.iseries.langref.doc/c0925395446.htm It says: When used in nested programs, the SORT-RETURN special register is implicitly defined as GLOBAL in the outermost COBOL program. The SORT-RETURN special register contains a return code of 0 (successful) or 16 (unsuccessful) at the completion of a sort/merge operation. You can set the SORT-RETURN special register to 16 in an error declarative or input/output procedure to terminate a sort/merge operation before all records are processed. The operation is terminated before a record is RETURNed or RELEASEd. You may specify the SORT-RETURN special register in a function wherever an integer argument is allowed.
-
next
-
nextRecord
- Throws:
AtEndExceptionIOStatusException
-
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
-
get
-
getAllRows
-
insert
public void insert()automaticaly adds the stringified value of the sortFile (sortField was passed to SortManager constructor) -
insert
Also add the new value to the sortField (sortField was passed to SortManager constructor)- Parameters:
newValue-
-
addAll
Append all elements to the sort- Parameters:
newValue-
-
clear
public void clear()Clear all rows- Parameters:
newValue-
-
remove
public void remove(int index) -
getSortResult
public static int getSortResult() -
setSortResult
public static void setSortResult(int sortResult)
-