asjava.uniobjects
Class UniFile

java.lang.Object
  extended byasjava.uniobjects.UniBase
      extended byasjava.uniobjects.UniFile
Direct Known Subclasses:
UniDictionary

public class UniFile
extends UniBase

UniFile is used to access to all file operations

Since:
UNIOBJECTS 1.0
Version:
Version 1.0
Author:
David T. Meeks

Field Summary
protected  int uniFileHandle
           
 
Fields inherited from class asjava.uniobjects.UniBase
inPacket, outPacket, uniConnection, uniEncryptionType, uniParentSession, uniStatus
 
Constructor Summary
UniFile()
          Default constructor for this class.
UniFile(UniSession aSession, java.lang.Object aFileName, int aDictFlag)
           
 
Method Summary
 void clearFile()
          clears a file, deleting all records contained within it.
 void close()
          closes the file.
 void deleteRecord()
          deletes the record identified by setRecordID.
 void deleteRecord(java.lang.Object aRecordIDObj)
          deletes the record identified by aRecordIDObj.
 UniDataSet deleteRecord(UniDataSet aDataSet)
          deletes the records identified by aDataSet UniDataSet object
protected  UniDataSet fileAction(int actionRequested, UniDataSet dataSet, java.lang.Object fieldList, int lockType)
           
 UniDynArray getAkInfo(java.lang.Object akNameObj)
          obtains information concerning the secondary key indexes available for this object.
 int getBlockingStrategy()
          returns the current blocking strategy.
 java.lang.String getFileName()
          returns the name of the file this object represents
 int getFileType()
          returns the type of file this is.
 int getLockStrategy()
          returns the current locking strategy.
 UniString getRecord()
          returns the contents of the record that was last read.
 java.lang.String getRecordID()
          returns the ID of the record that was last read.
 int getReleaseStrategy()
          returns the current release strategy.
 boolean isOpen()
          Denotes whether the file is open.
 boolean isRecordLocked()
          determines whether or not a user or session currently holds a lock on a given record ID.
 boolean isRecordLocked(java.lang.Object aRecordIDObj)
          determines whether or not a user or session currently holds a lock on a given record ID.
 UniString iType(java.lang.Object aRecordIDObj, java.lang.Object aITypeIDObj)
          Evalutes the specified I-descriptor and returns the evaluated string.
 void lockFile()
          locks this UniVerse file.
 void lockRecord(int aLockFlag)
          locks the recordID established with the setRecordIDmethod.
 void lockRecord(java.lang.Object aRecordIDObj, int aLockFlag)
          locks the recordID established with the aRecordIDObj argument..
 UniDataSet lockRecord(UniDataSet aDataSet, int aLockFlag)
          locks the recordIDs established with the UniDataSet object argument..
 void open()
          Opens the named file.
 UniString read()
          reads the UniVerse record from this file.
 UniString read(java.lang.Object aRecordIDObj)
          reads the UniVerse record from this file.
 UniString read(java.lang.Object aRecordIDObj, int aLockFlag)
          reads the UniVerse record from this file.
 UniDataSet read(UniDataSet aRowSet)
          reads the set of UniVerse records passed in via the UniDataSet object.
 UniString readField(java.lang.Object aRecordIDObj, int aFieldNumber)
          reads the specified field from the UniVerse record identified.
 UniString readField(java.lang.Object aRecordIDObj, int aFieldNumber, int aLockFlag)
          reads the specified field from the UniVerse record identified.
 UniDataSet readField(UniDataSet aRowSet, int aFieldNumber)
          reads the set of UniVerse records passed in via the UniDataSet object.
 UniDataSet readField(UniDataSet aRowSet, java.lang.Object aFieldNumber)
          reads the set of UniVerse records passed in via the UniDataSet object.
 UniString readNamedField(java.lang.Object aFieldNameObj)
          reads the field identifed by the named field in aFieldNameObj.
 UniString readNamedField(java.lang.Object aRecordIDObj, java.lang.Object aFieldNameObj)
          reads the field identifed by the named field in aFieldNameObj.
 UniDataSet readNamedField(UniDataSet aRowSet, java.lang.Object aFieldNameObj)
          reads the set of UniVerse records passed in via the UniDataSet object.
 void setBlockingStrategy(int aBlock)
          set the blocking strategy to the value indicated by the aBlock parameter.
 void setFileName(java.lang.Object aFileNameObj)
          set the filename to be opened
 void setLockStrategy(int aLock)
          set the locking strategy to the value indicated by the aLock parameter.
 void setRecord(java.lang.Object aStringObj)
          set the data portion of the record, primarily to be used for subsequent write methods.
 void setRecordID(java.lang.Object aStringObj)
          set the record ID of the record to be read
 void setReleaseStrategy(int aRelease)
          set the release strategy to the value indicated by the aRelease parameter.
 void unlockFile()
          unlocks the file
 void unlockRecord()
          unlocks the recordID established with the setRecordIDmethod.
 void unlockRecord(java.lang.Object aRecordIDObj)
          unlocks the recordID established with the aRecordIDObj parameter.
 void unlockRecord(UniDataSet aDataSet)
          unlocks the recordIDs established with the UniDataSet object argument..
 void write()
          used to write the data specified with the setRecord and setRecordID methods into the file.
 void write(java.lang.Object aRecordIDObj, java.lang.Object aRecordDataObj)
          used to write the data specified with the aRecordIDObj and aRecordDataObj parameters into the file.
 void write(java.lang.Object aRecordIDObj, java.lang.Object aRecordDataObj, int aLockFlag)
          used to write the data specified with the aRecordIDObj and aRecordDataObj parameters into the file.
 UniDataSet write(UniDataSet aDataSet)
          used to write the data specified with the aDataSet parameters into the file.
 void writeField(int uniFieldNumber)
          used to write the data specified with the setRecord and setRecordID methods into the file, but only the field specified.
 void writeField(java.lang.Object aRecordIDObj, java.lang.Object aRecordDataObj, int aFieldNumber)
          used to write the data specified with the aRecordIDObj and aRecordDataObj parameters into the file, but only the field specified.
 void writeField(java.lang.Object aRecordIDObj, java.lang.Object aRecordDataObj, int aFieldNumber, int aLockFlag)
          used to write the data specified with the aRecordIDObj and aRecordDataObj parameters into the file, but only the field specified.
 UniDataSet writeField(UniDataSet aDataSet, int uniFieldNumber)
          used to write the data specified with the aDataSet parameters into the file.
 UniDataSet writeField(UniDataSet aDataSet, java.lang.Object uniFieldName)
          used to write the data specified with the aDataSet parameters into the file.
 void writeNamedField(java.lang.Object aFieldName, java.lang.Object aString)
          used to write the data specified with the aRecordIDObj and aRecordDataObj parameters into the file, but only the name field specified.
 void writeNamedField(java.lang.Object aRecordID, java.lang.Object aFieldName, java.lang.Object aString)
          used to write the data specified with the aRecordID and aRecordDataObj parameters into the file, but only the name field specified.
 UniDataSet writeNamedField(UniDataSet aDataSet, java.lang.Object aFieldName)
          used to write the data specified with the aDataSet parameters into the file.
 
Methods inherited from class asjava.uniobjects.UniBase
getEncryptionType, isCommandActive, setEncryptionType, status
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uniFileHandle

protected int uniFileHandle
Constructor Detail

UniFile

public UniFile()
        throws UniFileException
Default constructor for this class.

Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0

UniFile

public UniFile(UniSession aSession,
               java.lang.Object aFileName,
               int aDictFlag)
        throws UniFileException
Method Detail

clearFile

public void clearFile()
               throws UniFileException
clears a file, deleting all records contained within it. If a file is locked by another user, the BlockingStrategy, which can be set with the setBlockingStrategy method, determines the behavior

Throws:
UniFileException - is thrown is an error occurs
Since:
UNIOBJECTS 1.0

close

public void close()
           throws UniFileException
closes the file. All file and record locks are released

Throws:
UniFileException - is thrown is an error occurs
Since:
UNIOBJECTS 1.0

deleteRecord

public void deleteRecord()
                  throws UniFileException
deletes the record identified by setRecordID.

Throws:
UniFileException - is thrown is an error occurs
Since:
UNIOBJECTS 1.0

deleteRecord

public UniDataSet deleteRecord(UniDataSet aDataSet)
                        throws UniFileException
deletes the records identified by aDataSet UniDataSet object

Parameters:
aDataSet - UniDataSet object which identifies which record IDs to be deleted.
Throws:
UniFileException - is thrown is an error occurs
Since:
UNIOBJECTS 1.0

deleteRecord

public void deleteRecord(java.lang.Object aRecordIDObj)
                  throws UniFileException
deletes the record identified by aRecordIDObj.

Parameters:
aRecordIDObj - identifies which record ID is to be deleted.
Throws:
UniFileException - is thrown is an error occurs
Since:
UNIOBJECTS 1.0

getAkInfo

public UniDynArray getAkInfo(java.lang.Object akNameObj)
                      throws UniFileException
obtains information concerning the secondary key indexes available for this object. The return value will vary depending on the type of index, as follows: If akNameObj is passed in as an empty string, then the list of available indices is returned

Parameters:
akNameObj - name of the index to query about
Returns:
the information concerning the given index, or a list of all the indexes available
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0

getBlockingStrategy

public int getBlockingStrategy()
returns the current blocking strategy. The initial value is inherited from the UniSession.setDefaultBlockingStrategy method. Valid values are:

Returns:
integer representing the current blocking strategy for this object
Since:
UNIOBJECTS 1.0
See Also:
setBlockingStrategy(int)

getFileName

public java.lang.String getFileName()
returns the name of the file this object represents

Returns:
String representing the UniVerse file that was opened
Since:
UNIOBJECTS 1.0
See Also:
setFileName(java.lang.Object)

getFileType

public int getFileType()
returns the type of file this is. The file is either a static hashed (2-18), directory (1 or 19), b-tree (25), or dynamic (30).

Returns:
integer representing the type of UniVerse file that was opened.
Since:
UNIOBJECTS 1.0

getLockStrategy

public int getLockStrategy()
returns the current locking strategy. The initial value is inherited from the UniSession.setDefaultLockStrategy method. Valid values are:

Returns:
integer representing the current locking strategy for this object
Since:
UNIOBJECTS 1.0
See Also:
setLockStrategy(int)

getRecord

public UniString getRecord()
returns the contents of the record that was last read. It is updated every time a read, readField, or readNamedField is performed.

Returns:
UniString representing the data that was last read
Since:
UNIOBJECTS 1.0
See Also:
setRecord(java.lang.Object), read(), readField(java.lang.Object, int), readNamedField(java.lang.Object)

getRecordID

public java.lang.String getRecordID()
returns the ID of the record that was last read. It is updated every time a read, readField, or readNamedField is performed.

Returns:
String representing the ID of the data that was last read
Since:
UNIOBJECTS 1.0
See Also:
setRecordID(java.lang.Object), read(), readField(java.lang.Object, int), readNamedField(java.lang.Object)

getReleaseStrategy

public int getReleaseStrategy()
returns the current release strategy. The initial value is inherited from the UniSession.setDefaultReleaseStrategy method. Valid values are:

isOpen

public boolean isOpen()
Denotes whether the file is open. A true value indicates the file is still open for use, a false indicates the file is closed and unavailable until reopened.

Returns:
boolean representing whether the file is opened or closed
Since:
UNIOBJECTS 1.0

isRecordLocked

public boolean isRecordLocked()
                       throws UniFileException
determines whether or not a user or session currently holds a lock on a given record ID.

Returns:
boolean representing whether the record is locked.
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0

isRecordLocked

public boolean isRecordLocked(java.lang.Object aRecordIDObj)
                       throws UniFileException
determines whether or not a user or session currently holds a lock on a given record ID.

Parameters:
aRecordIDObj - represents the record ID to be checked.
Returns:
boolean representing whether the record is locked.
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0

iType

public UniString iType(java.lang.Object aRecordIDObj,
                       java.lang.Object aITypeIDObj)
                throws UniFileException
Evalutes the specified I-descriptor and returns the evaluated string. It applies no conversion to the data.

Parameters:
aRecordIDObj - record ID of the record supplied as data to the Itype facility
aITypeIDObj - record ID of the Idescriptor record to be evaluated
Returns:
UniString representing the evaluated string
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0

lockFile

public void lockFile()
              throws UniFileException
locks this UniVerse file. If another user currently owns a lock, it will throw a UniFileException

Throws:
UniFileException - is thrown if an error is detected
Since:
UNIOBJECTS 1.0

lockRecord

public void lockRecord(int aLockFlag)
                throws UniFileException
locks the recordID established with the setRecordIDmethod. This method is used to override the current locking strategy

Parameters:
aLockFlag - Type of lock to set. Valid values are:
  • EXCLUSIVE_UPDATE (1) - Sets a READU lock
  • SHARED_READ (2) - Sets a READL lock
Throws:
UniFileException - is thrown if an error is detected
Since:
UNIOBJECTS 1.0

lockRecord

public void lockRecord(java.lang.Object aRecordIDObj,
                       int aLockFlag)
                throws UniFileException
locks the recordID established with the aRecordIDObj argument.. This method is used to override the current locking strategy

Parameters:
aRecordIDObj - String denoting which record ID to lock
aLockFlag - Type of lock to set. Valid values are:
  • EXCLUSIVE_UPDATE (1) - Sets a READU lock
  • SHARED_READ (2) - Sets a READL lock
Throws:
UniFileException - is thrown if an error is detected
Since:
UNIOBJECTS 1.0

lockRecord

public UniDataSet lockRecord(UniDataSet aDataSet,
                             int aLockFlag)
                      throws UniFileException
locks the recordIDs established with the UniDataSet object argument.. This method is used to override the current locking strategy

Parameters:
aDataSet - UniDataSet denoting which record IDs to lock
aLockFlag - Type of lock to set. Valid values are:
  • EXCLUSIVE_UPDATE (1) - Sets a READU lock
  • SHARED_READ (2) - Sets a READL lock
Returns:
UniDataSet object denoting which records were successfully locked
Throws:
UniFileException - is thrown if an error is detected
Since:
UNIOBJECTS 1.0

open

public void open()
          throws UniFileException
Opens the named file. If it cannot be opened, a UniFileException will be thrown

Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0

read

public UniString read()
               throws UniFileException
reads the UniVerse record from this file. It uses the record ID established via the setRecordID method.

Returns:
UniString representing the data read
Throws:
UniFileException - will be thrown if an error occurs
Since:
UNIOBJECTS 1.0
See Also:
setRecordID(java.lang.Object)

read

public UniDataSet read(UniDataSet aRowSet)
                throws UniFileException
reads the set of UniVerse records passed in via the UniDataSet object. This UniDataSet object should contain the list of record IDs to be read from this file.

Parameters:
aRowSet - list of record IDs to be read from this file
Returns:
UniDataSet representing the data read
Throws:
UniFileException - will be thrown if an error occurs
Since:
UNIOBJECTS 1.0

read

public UniString read(java.lang.Object aRecordIDObj)
               throws UniFileException
reads the UniVerse record from this file. It uses the record ID established via the aRecordIDObj argument that is passed in.

Parameters:
aRecordIDObj - record ID to be read from the file
Returns:
UniString representing the data read
Throws:
UniFileException - will be thrown if an error occurs
Since:
UNIOBJECTS 1.0

read

public UniString read(java.lang.Object aRecordIDObj,
                      int aLockFlag)
               throws UniFileException
reads the UniVerse record from this file. It uses the record ID established via the aRecordIDObj argument that is passed in. It will also lock the record according to the aLockFlag argument that is passed in.

Parameters:
aRecordIDObj - record ID to be read from the file
aLockFlag - is the type of lock that is to be set. See setLockStrategy for details on valid values
Returns:
UniString representing the data read
Throws:
UniFileException - will be thrown if an error occurs
Since:
UNIOBJECTS 1.0
See Also:
setLockStrategy(int)

readField

public UniString readField(java.lang.Object aRecordIDObj,
                           int aFieldNumber)
                    throws UniFileException
reads the specified field from the UniVerse record identified. It uses the record ID established via the aRecordIDObj argument that is passed in. It will return only the field number specified in aFieldNumber

Parameters:
aRecordIDObj - record ID to be read from the file
aFieldNumber - integer representing which field is to be read
Returns:
UniString representing the data read
Throws:
UniFileException - will be thrown if an error occurs
Since:
UNIOBJECTS 1.0

readField

public UniString readField(java.lang.Object aRecordIDObj,
                           int aFieldNumber,
                           int aLockFlag)
                    throws UniFileException
reads the specified field from the UniVerse record identified. It uses the record ID established via the aRecordIDObj argument that is passed in. It will return only the field number specified in aFieldNumber. It will set a lock on the record based on the value of aLockFlag

Parameters:
aRecordIDObj - record ID to be read from the file
aFieldNumber - integer representing which field is to be read
aLockFlag - type of lock to be set on the record
Returns:
UniString representing the data read
Throws:
UniFileException - will be thrown if an error occurs
Since:
UNIOBJECTS 1.0

readField

public UniDataSet readField(UniDataSet aRowSet,
                            int aFieldNumber)
                     throws UniFileException
reads the set of UniVerse records passed in via the UniDataSet object. This UniDataSet object should contain the list of record IDs to be read from this file.

Parameters:
aRowSet - list of record IDs to be read from this file
Returns:
UniDataSet representing the data read
Throws:
UniFileException - will be thrown if an error occurs
Since:
UNIOBJECTS 1.0

readField

public UniDataSet readField(UniDataSet aRowSet,
                            java.lang.Object aFieldNumber)
                     throws UniFileException
reads the set of UniVerse records passed in via the UniDataSet object. This UniDataSet object should contain the list of record IDs to be read from this file.

Parameters:
aRowSet - list of record IDs to be read from this file
Returns:
UniDataSet representing the data read
Throws:
UniFileException - will be thrown if an error occurs
Since:
UNIOBJECTS 1.0

readNamedField

public UniString readNamedField(java.lang.Object aFieldNameObj)
                         throws UniFileException
reads the field identifed by the named field in aFieldNameObj. It does this by extracting the physical field number from the dictionary associated with this file, and then performs a readField on that field. It will use the record ID established via the setRecordID as the record to be read

Parameters:
aFieldNameObj - name of the field in the dictionary to use as the field number
Returns:
UniString representing the data read
Throws:
UniFileException - will be thrown if an error occurs
Since:
UNIOBJECTS 1.0

readNamedField

public UniString readNamedField(java.lang.Object aRecordIDObj,
                                java.lang.Object aFieldNameObj)
                         throws UniFileException
reads the field identifed by the named field in aFieldNameObj. It does this by extracting the physical field number from the dictionary associated with this file, and then performs a readField on that field.

Parameters:
aRecordIDObj - record ID to be read
aFieldNameObj - name of the field in the dictionary to use as the field number
Returns:
UniString representing the data read
Throws:
UniFileException - will be thrown if an error occurs
Since:
UNIOBJECTS 1.0

readNamedField

public UniDataSet readNamedField(UniDataSet aRowSet,
                                 java.lang.Object aFieldNameObj)
                          throws UniFileException
reads the set of UniVerse records passed in via the UniDataSet object. This UniDataSet object should contain the list of record IDs to be read from this file.

Parameters:
aRowSet - list of record IDs to be read from this file
aFieldNameObj - name of the field in the dictionary to use as the field number
Returns:
UniDataSet representing the data read
Throws:
UniFileException - will be thrown if an error occurs
Since:
UNIOBJECTS 1.0

setBlockingStrategy

public void setBlockingStrategy(int aBlock)
                         throws UniFileException
set the blocking strategy to the value indicated by the aBlock parameter.

Parameters:
aBlock - integer representing the blocking strategy to be used
Throws:
UniFileException - is thrown if an invalid blocking strategy is set
Since:
UNIOBJECTS 1.0
See Also:
getBlockingStrategy()

setFileName

public void setFileName(java.lang.Object aFileNameObj)
set the filename to be opened

Parameters:
aFileNameObj - name of the UniVerse file to be opened
Since:
UNIOBJECTS 1.0
See Also:
getFileName()

setLockStrategy

public void setLockStrategy(int aLock)
                     throws UniFileException
set the locking strategy to the value indicated by the aLock parameter.

Parameters:
aLock - integer representing the locking strategy to be used
Throws:
UniFileException - is thrown if an invalid blocking strategy is set
Since:
UNIOBJECTS 1.0
See Also:
getLockStrategy()

setRecord

public void setRecord(java.lang.Object aStringObj)
set the data portion of the record, primarily to be used for subsequent write methods.

Parameters:
aStringObj - data portion of the record
Since:
UNIOBJECTS 1.0
See Also:
getRecord(), write()

setRecordID

public void setRecordID(java.lang.Object aStringObj)
                 throws UniFileException
set the record ID of the record to be read

Parameters:
aStringObj - String representing the record ID to be read from the file
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0
See Also:
getRecordID()

setReleaseStrategy

public void setReleaseStrategy(int aRelease)
                        throws UniFileException
set the release strategy to the value indicated by the aRelease parameter.

Parameters:
aRelease - integer representing the release strategy to be used
Throws:
UniFileException
Since:
UNIOBJECTS 1.0
See Also:
getReleaseStrategy()

unlockFile

public void unlockFile()
                throws UniFileException
unlocks the file

Throws:
UniFileException - is thrown if an error is detected
Since:
UNIOBJECTS 1.0
See Also:
lockFile()

unlockRecord

public void unlockRecord()
                  throws UniFileException
unlocks the recordID established with the setRecordIDmethod.

Throws:
UniFileException - is thrown if an error is detected
Since:
UNIOBJECTS 1.0
See Also:
setRecordID(java.lang.Object)

unlockRecord

public void unlockRecord(UniDataSet aDataSet)
                  throws UniFileException
unlocks the recordIDs established with the UniDataSet object argument..

Parameters:
aDataSet - UniDataSet denoting which record IDs to lock
Throws:
UniFileException - is thrown if an error is detected
Since:
UNIOBJECTS 1.0

unlockRecord

public void unlockRecord(java.lang.Object aRecordIDObj)
                  throws UniFileException
unlocks the recordID established with the aRecordIDObj parameter.

Parameters:
aRecordIDObj - record id to be unlocked
Throws:
UniFileException - is thrown if an error is detected
Since:
UNIOBJECTS 1.0
See Also:
setRecordID(java.lang.Object)

write

public void write()
           throws UniFileException
used to write the data specified with the setRecord and setRecordID methods into the file. After completion, the status method can be used to determine the results of the operation. A 0 indicates the record was locked, a -2 indicates it was not locked

Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0
See Also:
setRecord(java.lang.Object), setRecordID(java.lang.Object), UniBase.status()

write

public void write(java.lang.Object aRecordIDObj,
                  java.lang.Object aRecordDataObj)
           throws UniFileException
used to write the data specified with the aRecordIDObj and aRecordDataObj parameters into the file. After completion, the status method can be used to determine the results of the operation. A 0 indicates the record was locked, a -2 indicates it was not locked

Parameters:
aRecordIDObj - record ID that is to be written
aRecordDataObj - record data that is to be written
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0
See Also:
setRecord(java.lang.Object), setRecordID(java.lang.Object), UniBase.status()

write

public void write(java.lang.Object aRecordIDObj,
                  java.lang.Object aRecordDataObj,
                  int aLockFlag)
           throws UniFileException
used to write the data specified with the aRecordIDObj and aRecordDataObj parameters into the file. After completion, the status method can be used to determine the results of the operation. A 0 indicates the record was locked, a -2 indicates it was not locked. You can use this version to also specify the kind of locking to be used during the write operation

Parameters:
aRecordIDObj - record ID that is to be written
aRecordDataObj - record data that is to be written
aLockFlag - type of lock to be set
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0
See Also:
setRecord(java.lang.Object), setRecordID(java.lang.Object), UniBase.status()

write

public UniDataSet write(UniDataSet aDataSet)
                 throws UniFileException
used to write the data specified with the aDataSet parameters into the file. After completion, the returned UniDataSet object can be used to determine the results of the operation. A 0 indicates the record was locked, a -2 indicates it was not locked

Parameters:
aDataSet - UniDataSet object representing the data that is to be written
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0

writeField

public void writeField(int uniFieldNumber)
                throws UniFileException
used to write the data specified with the setRecord and setRecordID methods into the file, but only the field specified. After completion, the status method can be used to determine the results of the operation. A 0 indicates the record was locked, a -2 indicates it was not locked

Parameters:
uniFieldNumber - field to be written
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0
See Also:
setRecord(java.lang.Object), setRecordID(java.lang.Object), UniBase.status()

writeField

public UniDataSet writeField(UniDataSet aDataSet,
                             int uniFieldNumber)
                      throws UniFileException
used to write the data specified with the aDataSet parameters into the file. After completion, the returned UniDataSet object can be used to determine the results of the operation. A 0 indicates the record was locked, a -2 indicates it was not locked

Parameters:
aDataSet - UniDataSet object representing the data that is to be written
uniFieldNumber - field to be written
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0

writeField

public UniDataSet writeField(UniDataSet aDataSet,
                             java.lang.Object uniFieldName)
                      throws UniFileException
used to write the data specified with the aDataSet parameters into the file. After completion, the returned UniDataSet object can be used to determine the results of the operation. A 0 indicates the record was locked, a -2 indicates it was not locked

Parameters:
aDataSet - UniDataSet object representing the data that is to be written
uniFieldName - field to be written
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0

writeField

public void writeField(java.lang.Object aRecordIDObj,
                       java.lang.Object aRecordDataObj,
                       int aFieldNumber)
                throws UniFileException
used to write the data specified with the aRecordIDObj and aRecordDataObj parameters into the file, but only the field specified. After completion, the status method can be used to determine the results of the operation. A 0 indicates the record was locked, a -2 indicates it was not locked

Parameters:
aRecordIDObj - record ID to be written
aRecordDataObj - data to be written
aFieldNumber - field within the record to be written
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0
See Also:
UniBase.status()

writeField

public void writeField(java.lang.Object aRecordIDObj,
                       java.lang.Object aRecordDataObj,
                       int aFieldNumber,
                       int aLockFlag)
                throws UniFileException
used to write the data specified with the aRecordIDObj and aRecordDataObj parameters into the file, but only the field specified. After completion, the status method can be used to determine the results of the operation. A 0 indicates the record was locked, a -2 indicates it was not locked. You can also specify the specific locking to be used via the aLockFlag parameter

Parameters:
aRecordIDObj - record ID to be written
aRecordDataObj - data to be written
aFieldNumber - field within the record to be written
aLockFlag - integer representing the type of lock to be set.
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0
See Also:
UniBase.status()

writeNamedField

public void writeNamedField(java.lang.Object aFieldName,
                            java.lang.Object aString)
                     throws UniFileException
used to write the data specified with the aRecordIDObj and aRecordDataObj parameters into the file, but only the name field specified. The Named Field is extracted from the files Dictionary. After completion, the status method can be used to determine the results of the operation. A 0 indicates the record was locked, a -2 indicates it was not locked

Parameters:
aFieldName - name of the field that is to be written
aString - data to be written to that field
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0
See Also:
UniBase.status()

writeNamedField

public void writeNamedField(java.lang.Object aRecordID,
                            java.lang.Object aFieldName,
                            java.lang.Object aString)
                     throws UniFileException
used to write the data specified with the aRecordID and aRecordDataObj parameters into the file, but only the name field specified. The Named Field is extracted from the files Dictionary. After completion, the status method can be used to determine the results of the operation. A 0 indicates the record was locked, a -2 indicates it was not locked

Parameters:
aRecordID - record ID that is to be written
aFieldName - name of the field that is to be written
aString - data to be written to that field
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0
See Also:
UniBase.status()

writeNamedField

public UniDataSet writeNamedField(UniDataSet aDataSet,
                                  java.lang.Object aFieldName)
                           throws UniFileException
used to write the data specified with the aDataSet parameters into the file. After completion, the returned UniDataSet object can be used to determine the results of the operation. A 0 indicates the record was locked, a -2 indicates it was not locked

Parameters:
aDataSet - UniDataSet object representing the data that is to be written
aFieldName - field to be written
Throws:
UniFileException - is thrown if an error occurs
Since:
UNIOBJECTS 1.0

fileAction

protected UniDataSet fileAction(int actionRequested,
                                UniDataSet dataSet,
                                java.lang.Object fieldList,
                                int lockType)
                         throws UniFileException
Throws:
UniFileException