public abstract class AbstractTempTable extends HandleChain implements TempTable, Deletable
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractTempTable.CallingFunction
Enumeration which represents some temp-table functions.
|
Modifier and Type | Field and Description |
---|---|
protected character |
admData
Corresponds ADM-DATA attribute.
|
protected static java.lang.String |
DEFAULT_COPY_TEMP_TABLE_PREFIX
Default prefix for the name of a temp-table copied with COPY-TEMP-TABLE.
|
protected handle |
defaultBufferHandle
Default buffer handle.
|
protected logical |
error
Corresponds ERROR attribute.
|
protected character |
errorString
Corresponds ERROR-STRING attribute.
|
protected boolean |
undoable
true if changes made to the records the temporary table can be undone. |
private integer |
uniqueId
Corresponds UNIQUE-ID attribute.
|
name, nextSibling, prevSibling
instProc
Constructor and Description |
---|
AbstractTempTable(boolean dynamic)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
_hasRecords()
Worker for
hasRecords . |
protected abstract boolean |
addFunctionWasCalled()
Determine if an ADD-* function was called for the table (CLEAR function resets the state).
|
logical |
canUndo()
Obtain the current UNDO attribute of 4GL temp-table.
|
void |
changeErrorString(character errStr)
Sets the ERROR-STRING attribute of 4GL temp-table.
|
logical |
copyTempTable(handle other)
Copies the other temp-table.
|
logical |
copyTempTable(handle other,
boolean append)
Copies the other temp-table.
|
logical |
copyTempTable(handle other,
boolean append,
boolean replace)
Copies the other temp-table.
|
logical |
copyTempTable(handle other,
boolean append,
boolean replace,
boolean looseCopy)
Copies the other temp-table.
|
logical |
copyTempTable(handle other,
boolean append,
boolean replace,
boolean looseCopy,
java.lang.String prefix)
Copies the other temp-table.
|
logical |
copyTempTable(handle other,
logical append)
Copies the other temp-table.
|
logical |
copyTempTable(handle other,
logical append,
logical replace)
Copies the other temp-table.
|
logical |
copyTempTable(handle other,
logical append,
logical replace,
logical looseCopy)
Copies the other temp-table.
|
logical |
copyTempTable(handle other,
logical append,
logical replace,
logical looseCopy,
character prefix)
Copies the other temp-table.
|
(package private) TemporaryBuffer |
defaultBuffer()
Get default buffer for the static temp-table.
|
protected void |
deleteAllBuffers()
Delete all the buffers (master and slave) associated with this temporary table (static or
dynamic).
|
protected void |
displayCannotClear()
Display "CLEAR method may not be called on a static temp-table object, nor on a dynamic one
with records; use buffer:EMPTY-TEMP-TABLE" error message.
|
protected void |
displayCopyTempTableHalfDefined()
Display "COPY-TEMP-TABLE target temp-table must be either PREPARED or CLEAR, but not
half-defined" error message.
|
protected void |
displayCopyTempTableInvalidFirstArg()
Display "COPY-TEMP-TABLE must have valid buffer/temp-table handle as first argument" error
message.
|
protected void |
displayCouldNotFindLikeTableFromHandle()
Display "TEMP-TABLE method could not find LIKE table from BUFFER handle" error message.
|
protected void |
displayCreateLikeNotFirst()
Display "CREATE-LIKE must be the first method on a newly CREATEd TEMP-TABLE, or a newly
CLEARed one" error message.
|
protected void |
displayNotPrepared()
Display "TEMP-TABLE must be PREPARED before referencing NAME/DEFAULT-BUFFER-HANDLE etc"
error message.
|
protected void |
displayPrepared()
Display "Definitional TEMP-TABLE methods (ADD-NEW/LIKE) may not be called after
TEMP-TABLE-PREPARE has been called unless a CLEAR is done first, and may never be called on
a DEFINED static table" error message.
|
protected void |
displayPreparedIgnoring()
Display "TEMP-TABLE is already prepared--ignoring" error message.
|
protected void |
displayUnableAddFieldsFrom()
Display "Unable to ADD-FIELDS-FROM for TEMP-TABLE" error message.
|
protected void |
displayUnableAssignUnknownUndo()
Display "Unable to assign UNKNOWN value to attribute UNDO on TEMP-TABLE widget" error
message.
|
protected void |
displayUnableCreateLike()
Display "Unable to CREATE-LIKE for TEMP-TABLE--try using a smaller source table" error
message.
|
character |
errorString()
Obtain the current ERROR-STRING attribute of 4GL temp-table.
|
character |
getADMData()
Get the value of the ADM-DATA attribute.
|
protected RecordBuffer |
getRecordBufferByHandle(handle hbuf,
AbstractTempTable.CallingFunction callingFunction)
Get record buffer by buffer or temp-table handle.
|
integer |
getUniqueID()
Gets the the unique ID number associated to this object by the
underlying system.
|
logical |
hasRecords()
Checks whether this temp-table contains any records.
|
logical |
isError()
Returns the state of the ERROR attribute
|
boolean |
isUndoable()
Get the current value of UNDO attribute of this temp-table.
|
void |
setADMData(character value)
Set the value of the ADM-DATA attribute.
|
void |
setADMData(java.lang.String value)
Set the value of the ADM-DATA attribute.
|
void |
setCanUndo(logical undo)
Sets the UNDO attribute of 4GL temp-table.
|
void |
setError(boolean value)
Setter for ERROR attribute.
|
void |
setError(logical value)
Setter for ERROR attribute.
|
delete, firstResource, firstResource, getHead, getNextSibling, getNextSibling, getPrevSibling, getPrevSibling, getPrivateData, getTail, hasName, hasNameReadOnly, hasNextSibling, hasParent, hasPrevSibling, hasPrivateData, interlink, isChained, lastResource, lastResource, moveInChain, name, name, name, readOnlyError, resourceDelete, setHead, setNextSibling, setNextSibling, setPrevSibling, setPrevSibling, setPrivateData, setPrivateData, setPrivateData
getResourceType, id, id, implicitDeletion, instantiatingProcedure, invalidAttribute, setInstantiatingProcedure, type, unknown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addFieldLike, addFieldLike, addFieldLike, addFieldLike, addFieldsFrom, addFieldsFrom, addFieldsFrom, addFieldsFrom, addFieldsFrom, addFieldsFrom, addFieldsFrom, addFieldsFrom, addFieldToIndex, addFieldToIndex, addFieldToIndex, addFieldToIndex, addFieldToIndex, addFieldToIndex, addFieldToIndex, addFieldToIndex, addFieldToIndex, addFieldToIndex, addFieldToIndex, addFieldToIndex, addIndexLike, addIndexLike, addIndexLike, addIndexLike, addNewField, addNewField, addNewField, addNewField, addNewField, addNewField, addNewIndex, addNewIndex, addNewIndex, addNewIndex, clear, createTableLike, createTableLike, createTableLike, createTableLike, createTableLike, createTableLike, createTableLike, getDMOClass, getDMOInterface, prepared, tempTablePrepare, tempTablePrepare
defaultBufferHandle
getNextSibling, getPrevSibling, getPrivateData, setPrivateData, setPrivateData
getResourceType, readOnlyError
id, id, unknown, valid
_dynamic, dynamic
instantiatingProcedure
protected static final java.lang.String DEFAULT_COPY_TEMP_TABLE_PREFIX
protected handle defaultBufferHandle
protected final character errorString
protected final logical error
protected final character admData
protected boolean undoable
true
if changes made to the records the temporary table can be undone.private final integer uniqueId
public AbstractTempTable(boolean dynamic)
dynamic
- Flag indicating if this is a static or a dynamic temp-table.public integer getUniqueID()
getUniqueID
in interface UniqueID
public logical copyTempTable(handle other)
copyTempTable
in interface TempTable
other
- Some other temp-table to copy from.public logical copyTempTable(handle other, logical append)
copyTempTable
in interface TempTable
other
- Some other temp-table to copy from.append
- Append mode.public logical copyTempTable(handle other, logical append, logical replace)
copyTempTable
in interface TempTable
other
- Some other temp-table to copy from.append
- Append mode.replace
- Replace mode.public logical copyTempTable(handle other, logical append, logical replace, logical looseCopy)
copyTempTable
in interface TempTable
other
- Some other temp-table to copy from.append
- Append mode.replace
- Replace mode.looseCopy
- Loose copy mode.public logical copyTempTable(handle other, boolean append)
copyTempTable
in interface TempTable
other
- Some other temp-table to copy from.append
- Append mode.public logical copyTempTable(handle other, boolean append, boolean replace)
copyTempTable
in interface TempTable
other
- Some other temp-table to copy from.append
- Append mode.replace
- Replace mode.public logical copyTempTable(handle other, boolean append, boolean replace, boolean looseCopy)
copyTempTable
in interface TempTable
other
- Some other temp-table to copy from.append
- Append mode.replace
- Replace mode.looseCopy
- Loose copy mode.public logical copyTempTable(handle other, boolean append, boolean replace, boolean looseCopy, java.lang.String prefix)
copyTempTable
in interface TempTable
other
- Some other temp-table to copy from.append
- Append mode.replace
- Replace mode.looseCopy
- Loose copy mode.prefix
- Prefix for naming the copied temp-table.public logical copyTempTable(handle other, logical append, logical replace, logical looseCopy, character prefix)
copyTempTable
in interface TempTable
other
- Some other temp-table to copy from.append
- Append mode.replace
- Replace mode.looseCopy
- Loose copy mode.prefix
- Prefix for naming the copied temp-table.public void changeErrorString(character errStr)
changeErrorString
in interface TempTable
errStr
- The new value for the ERROR-STRING attribute.public character errorString()
errorString
in interface TempTable
public character getADMData()
getADMData
in interface ADMData
public void setADMData(java.lang.String value)
setADMData
in interface ADMData
value
- The new value.public void setADMData(character value)
setADMData
in interface ADMData
value
- The new value.public logical isError()
public void setError(boolean value)
public void setError(logical value)
public void setCanUndo(logical undo)
setCanUndo
in interface TempTable
undo
- The new value for the attribute.public logical canUndo()
public logical hasRecords()
hasRecords
in interface TempTable
public final boolean isUndoable()
isUndoable
in interface UndoStateProvider
TemporaryBuffer defaultBuffer()
protected abstract boolean addFunctionWasCalled()
true
if an ADD-* function was called for the table.protected void deleteAllBuffers()
protected boolean _hasRecords()
hasRecords
. Checks whether this temp-table contains any records.protected void displayCreateLikeNotFirst()
protected void displayPrepared()
protected void displayPreparedIgnoring()
protected void displayUnableAssignUnknownUndo()
protected void displayCannotClear()
protected void displayNotPrepared()
protected void displayUnableCreateLike()
protected void displayUnableAddFieldsFrom()
protected void displayCouldNotFindLikeTableFromHandle()
protected void displayCopyTempTableInvalidFirstArg()
protected void displayCopyTempTableHalfDefined()
protected RecordBuffer getRecordBufferByHandle(handle hbuf, AbstractTempTable.CallingFunction callingFunction)
hbuf
- Buffer or temp-table handle.callingFunction
- Calling function. Affects error messaging.null
if the case of error.