org.jclarion.clarion
Class ClarionBasicFile

java.lang.Object
  extended by org.jclarion.clarion.ClarionMemoryModel
      extended by org.jclarion.clarion.ClarionGroup
          extended by org.jclarion.clarion.ClarionFile
              extended by org.jclarion.clarion.ClarionBasicFile
All Implemented Interfaces:
Threaded

public class ClarionBasicFile
extends ClarionFile


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jclarion.clarion.ClarionGroup
ClarionGroup.GroupEntry, ClarionGroup.ReferenceVariable
 
Nested classes/interfaces inherited from class org.jclarion.clarion.ClarionMemoryModel
ClarionMemoryModel.State
 
Field Summary
 
Fields inherited from class org.jclarion.clarion.ClarionGroup
map
 
Constructor Summary
ClarionBasicFile()
           
 
Method Summary
 void add()
          insert new record based on contents of record buffer
 void add(int size)
          insert new record writing only fixed # of bytes.
 boolean bof()
          Retrun true if at beginning of file
 void buffer(java.lang.Integer pagesize, java.lang.Integer behind, java.lang.Integer ahead, java.lang.Integer timeout)
          Set record paging.
 void build()
          Rebuild key files
 void close()
          Close a file
 void create()
          Create new file.
 void delete()
          Delete current record
 boolean eof()
          Return true if at end of file
 void flush()
          Flush file buffers.
 void freeState(int state)
          Free memory held by stored state but do not restore state
 void get(ClarionKey akey)
          Get record based on particular key
 void get(ClarionNumber position, java.lang.Integer len)
           
 void get(ClarionString pointer, java.lang.Integer len)
          retrieve record based on specified pointer position - previously returned by pointer command.
protected  java.lang.String getDriver()
           
 ClarionString getNulls()
          Get encoding of status of nulls used by SQL files
 int getPointer()
          Get file pointer
 ClarionString getPosition(ClarionKey key)
           
 int getState()
          Save state of file to be restored later.
 void lock()
          Lock file
 void next()
          Get next record in current sequence
 void open(int mode)
          Open file in particular mode.
 void previous()
          Get prior record in current sequence
 void put()
          Rewrite current record
 int records()
          Return number of records in file
 void reget(ClarionKey key, ClarionString string)
           
 void remove()
          Delete a file.
 void reset(ClarionKey key, ClarionString string)
           
 void restoreState(int state)
          Restore state.
 void send(java.lang.String operator)
          Send special command to the file driver
 void set(ClarionKey key)
          Set key based record processing
 void set(int pos)
          Set sequentual record processing starting at position
 void setNulls(ClarionString nulls)
          Restore encoding of status of nulls used by SQL files
 void stream()
          Set output write caching on a file.
 void unlock()
          Unlock previously locked file
 void watch()
          Enable optimistic locking.
 
Methods inherited from class org.jclarion.clarion.ClarionFile
addKey, clearNull, commit, decodeByteArraySend, decodeCharArraySend, deregisterCallback, disposeFileState, duplicateCheck, functionCalled, functionDone, getBytes, getFileProperty, getFileState, getKey, getKey, getKeys, getName, getPosition, getPrimaryKey, getPrimaryKeyPosition, getProperty, getProperty, getProperty, getProperty, getSQLType, initThread, isPositionMatches, logout, open, reget, registerCallback, removeKey, removeKeys, reset, rollback, set, setClonedProperty, setClonedProperty, setCreate, setFileProperty, setName, setName, setNoMemo, setNull, setPrimaryKeyPosition, setProperty, setProperty, setProperty, setProperty, setSource, testOpen
 
Methods inherited from class org.jclarion.clarion.ClarionGroup
addReference, addVariable, addVariable, clear, clear, deserialize, flatWhat, flatWhere, flatWho, genericLike, getGroupObject, getGroupParam, getGroupParamPosition, getLockedObject, getPrefix, getString, getThread, getVariableCount, merge, serialize, setOver, setOver, setPrefix, setValue, setValue, what, where, who, whoNoPrefix
 
Methods inherited from class org.jclarion.clarion.ClarionMemoryModel
addChangeListener, addChangeListener, castTo, getListenerCount, isAnyoneInterestedInChange, isThreaded, lock, notifyChange, removeChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClarionBasicFile

public ClarionBasicFile()
Method Detail

add

public void add()
Description copied from class: ClarionFile
insert new record based on contents of record buffer

Specified by:
add in class ClarionFile

bof

public boolean bof()
Description copied from class: ClarionFile
Retrun true if at beginning of file

Specified by:
bof in class ClarionFile
Returns:

buffer

public void buffer(java.lang.Integer pagesize,
                   java.lang.Integer behind,
                   java.lang.Integer ahead,
                   java.lang.Integer timeout)
Description copied from class: ClarionFile
Set record paging. We will never bother with this one but will make it abstract anyway.

Specified by:
buffer in class ClarionFile

build

public void build()
Description copied from class: ClarionFile
Rebuild key files

Specified by:
build in class ClarionFile

close

public void close()
Description copied from class: ClarionFile
Close a file

Specified by:
close in class ClarionFile

create

public void create()
Description copied from class: ClarionFile
Create new file. If file already exists it will be overwritten. this call open after.

Specified by:
create in class ClarionFile

delete

public void delete()
Description copied from class: ClarionFile
Delete current record

Specified by:
delete in class ClarionFile

eof

public boolean eof()
Description copied from class: ClarionFile
Return true if at end of file

Specified by:
eof in class ClarionFile
Returns:

flush

public void flush()
Description copied from class: ClarionFile
Flush file buffers. Only applies for filesystem type files.

Specified by:
flush in class ClarionFile

freeState

public void freeState(int state)
Description copied from class: ClarionFile
Free memory held by stored state but do not restore state

Specified by:
freeState in class ClarionFile

get

public void get(ClarionKey akey)
Description copied from class: ClarionFile
Get record based on particular key

Specified by:
get in class ClarionFile

get

public void get(ClarionString pointer,
                java.lang.Integer len)
Description copied from class: ClarionFile
retrieve record based on specified pointer position - previously returned by pointer command.

Specified by:
get in class ClarionFile
Parameters:
pointer - - the position to get
len - - the number of bytes to read, for dos drivers etc

get

public void get(ClarionNumber position,
                java.lang.Integer len)
Specified by:
get in class ClarionFile

getNulls

public ClarionString getNulls()
Description copied from class: ClarionFile
Get encoding of status of nulls used by SQL files

Specified by:
getNulls in class ClarionFile
Returns:

getPointer

public int getPointer()
Description copied from class: ClarionFile
Get file pointer

Specified by:
getPointer in class ClarionFile
Returns:

getPosition

public ClarionString getPosition(ClarionKey key)
Specified by:
getPosition in class ClarionFile

getState

public int getState()
Description copied from class: ClarionFile
Save state of file to be restored later. Saving Current file state, open etc Contents of record buffer Watch status Variable change status Null variable states Sequentual processing position

Specified by:
getState in class ClarionFile

lock

public void lock()
Description copied from class: ClarionFile
Lock file

Specified by:
lock in class ClarionFile

next

public void next()
Description copied from class: ClarionFile
Get next record in current sequence

Specified by:
next in class ClarionFile

open

public void open(int mode)
Description copied from class: ClarionFile
Open file in particular mode. Supported modes are: User access: x00 = read only x01 = write only x02 = read/write Remote access: x00 = any x10 = deny all x20 = deny write x30 = deny read x40 = deny nothing Open default is x22 = Read/Write user but deny write remote.

Specified by:
open in class ClarionFile

previous

public void previous()
Description copied from class: ClarionFile
Get prior record in current sequence

Specified by:
previous in class ClarionFile

put

public void put()
Description copied from class: ClarionFile
Rewrite current record

Specified by:
put in class ClarionFile

records

public int records()
Description copied from class: ClarionFile
Return number of records in file

Specified by:
records in class ClarionFile
Returns:

reget

public void reget(ClarionKey key,
                  ClarionString string)
Specified by:
reget in class ClarionFile

remove

public void remove()
Description copied from class: ClarionFile
Delete a file.

Specified by:
remove in class ClarionFile

reset

public void reset(ClarionKey key,
                  ClarionString string)
Specified by:
reset in class ClarionFile

set

public void set(int pos)
Description copied from class: ClarionFile
Set sequentual record processing starting at position

Specified by:
set in class ClarionFile
Parameters:
pos - position - as returned by position method

restoreState

public void restoreState(int state)
Description copied from class: ClarionFile
Restore state. Memory is not freed

Specified by:
restoreState in class ClarionFile

send

public void send(java.lang.String operator)
Description copied from class: ClarionFile
Send special command to the file driver

Specified by:
send in class ClarionFile

set

public void set(ClarionKey key)
Description copied from class: ClarionFile
Set key based record processing

Specified by:
set in class ClarionFile

setNulls

public void setNulls(ClarionString nulls)
Description copied from class: ClarionFile
Restore encoding of status of nulls used by SQL files

Specified by:
setNulls in class ClarionFile

stream

public void stream()
Description copied from class: ClarionFile
Set output write caching on a file. By default it is disabled. Only applies for filesystem type files.

Specified by:
stream in class ClarionFile

unlock

public void unlock()
Description copied from class: ClarionFile
Unlock previously locked file

Specified by:
unlock in class ClarionFile

watch

public void watch()
Description copied from class: ClarionFile
Enable optimistic locking. On next get,next,previous or reget. make a note of contents of record. On subsequent put, fail operation if the record has changed in anyway error code for failure is 89. A second get,next,previous or reget will cancel the watch.

Specified by:
watch in class ClarionFile

getDriver

protected java.lang.String getDriver()
Specified by:
getDriver in class ClarionFile

add

public void add(int size)
Description copied from class: ClarionFile
insert new record writing only fixed # of bytes. Mainly for ascii and binary file drivers

Specified by:
add in class ClarionFile


Copyright © 2010. All Rights Reserved.