public interface IPLIFile
Modifier and Type | Interface and Description |
---|---|
static class |
IPLIFile.Attr
Keep track of a set of PL/I FILE attributes.
|
Modifier and Type | Field and Description |
---|---|
static java.util.EnumSet<IPLIFile.Attr> |
EnvAttrs
set of Attrs that are valid in FILE ENVIRONMENT clause
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the file
|
boolean |
delete()
Delete the current record (the last record read)
|
boolean |
delete(byte[] key)
Delete the record identified by the key specified when this file or index was opened,
which could be a primary or alternate key (IDX files).
|
boolean |
deleteByPrimary(byte[] key)
Delete the record identified by the primary /relative record key passed in as a byte array
|
boolean |
deleteFile()
Deletes the file
|
void |
endData()
Finish the GET DATA operation
|
java.lang.Object |
getData(java.lang.String name,
java.lang.Object var)
Perform a GET DATA operation (name=value variable retrieval) from an input stream
|
java.lang.String |
getDDName()
Return the DD name for this FILE, which is either the FILE variable or constant name
or an alternate to it specifiec with the TITLE attribute
|
java.util.EnumSet<IPLIFile.Attr> |
getDeclareFileAttributes()
Return the the set of file attributes used on the DCL
|
java.lang.String |
getDSName()
Return the dataset name for this FILE which has been passed as part of the TITLE
attribute or associated with the system property or environment variable associated with its DD name
|
java.lang.String |
getEnvironment()
Return the current environment settings defined for this file
|
java.util.EnumSet<IPLIFile.Attr> |
getOpenFileAttributes()
Return the the set of file attributes used on the OPEN FILE
|
java.lang.String |
getTitle()
Return the current title settings defined for this file
|
java.io.InputStream |
inputStream()
inputStream - return the Java InputStream associated with this PLI FILE
|
boolean |
isOpen()
indicate whether this file is open
|
boolean |
isStream()
Return true if the file is opened with attribute STREAM, false if otherwise
|
byte[] |
keyto()
Return the last key read as a result of a locate(), read() or readPrev()
|
boolean |
locate(byte[] key)
Locate a point within a keyed file, allowing subsequent read()s from that point forward
|
boolean |
open(java.util.EnumSet<IPLIFile.Attr> mode,
java.lang.String title,
java.lang.String environment,
int lineSize,
int pageSize)
Opens the file for read, write, both, extend
|
java.io.OutputStream |
outputStream()
Return the Java OutputStream associated with this PLI FILE
|
java.io.PrintStream |
printStream()
Return the Java PrintStream associated with this PLI FILE
|
byte[] |
read()
Read the next record (only if opened not-random)
|
byte[] |
read(byte[] key)
Read a single record with a key
|
byte[] |
readPrev()
Read the previous record (only if opened not-random)
|
boolean |
rewrite(byte[] record)
Rewrite the current record with the data and embedded key
|
boolean |
rewrite(byte[] record,
byte[] key)
Rewrite the record given by a key with the data and embedded key
|
java.util.Scanner |
scanner()
Return the Java Scanner associated with the InputStream within this PLI FILE
|
boolean |
write(byte[] record) |
boolean |
write(byte[] record,
byte[] externalKey) |
boolean |
write(byte[] record,
long rrn)
Write the file with the record and specific relative record number
|
static final java.util.EnumSet<IPLIFile.Attr> EnvAttrs
boolean isStream()
java.io.PrintStream printStream()
CONDITION(UNDEFINEDFILE)
- for files not opened, or cannot be converted,
to INPUT STREAMjava.io.InputStream inputStream()
CONDITION(UNDEFINEDFILE)
- for files not opened, or cannot be converted,
to PRINT STREAMjava.util.Scanner scanner()
CONDITION(UNDEFINEDFILE)
- for files not opened, or cannot be converted,
to PRINT STREAMjava.io.OutputStream outputStream()
CONDITION(UNDEFINEDFILE)
- for files not opened, or cannot be converted,
to PRINT STREAMjava.lang.Object getData(java.lang.String name, java.lang.Object var)
name
- - the name or partial name (i.e., part of a Group structure)var
- - the variable to retrieve (Array, Group, Integer, etc.)void endData()
java.lang.String getDDName()
java.lang.String getDSName()
java.lang.String getEnvironment()
java.lang.String getTitle()
java.util.EnumSet<IPLIFile.Attr> getDeclareFileAttributes()
java.util.EnumSet<IPLIFile.Attr> getOpenFileAttributes()
boolean open(java.util.EnumSet<IPLIFile.Attr> mode, java.lang.String title, java.lang.String environment, int lineSize, int pageSize)
mode
- an EnumSet of Attrstitle
- - the TITLE attribute or nullenvironment
- - the ENVIRONMENT attribute or nulllineSize
- - the LINESIZE attribute or 0pageSize
- - the PAGESIZE attribute or 0
read sequential disregarding key order; null to read sequentially in orderbykey()
key orderCondition.CONDITION.UNDEFINEDFILE
- if an error occurred during openboolean locate(byte[] key)
key
- the bytearray key to readCondition.CONDITION.UNDEFINEDFILE
- if the file is closed,
Condition.CONDITION.ERROR if a prior condition was ignoredbyte[] read(byte[] key)
key
- the bytearray key to readCondition.CONDITION.UNDEFINEDFILE
- if the file is closed,
Condition.CONDITION.ENDFILE if there are no more records to read,
Condition.CONDITION.ERROR if a prior condition was ignoredbyte[] read()
Condition.CONDITION.UNDEFINEDFILE
- if the file is closed,
Condition.CONDITION.ENDFILE if there are no more records to read,
Condition.CONDITION.ERROR if a prior condition was ignoredbyte[] readPrev()
Condition.CONDITION.UNDEFINEDFILE
- if the file is closed,
Condition.CONDITION.ENDFILE if there are no more records to read,
Condition.CONDITION.ERROR if a prior condition was ignoredbyte[] keyto()
Condition.CONDITION.UNDEFINEDFILE
- if the file is closed,
Condition.CONDITION.ENDFILE if there are no more records to read,
Condition.CONDITION.ERROR if a prior condition was ignoredboolean write(byte[] record, long rrn)
record
- bytearray of the recordCondition.CONDITION.UNDEFINEDFILE
- if the file is closed,
Condition.CONDITION.ERROR if a prior condition was ignoredboolean write(byte[] record)
boolean write(byte[] record, byte[] externalKey)
boolean rewrite(byte[] record)
record
- new bytearray of the recordCondition.CONDITION.UNDEFINEDFILE
- if the file is closed,
Condition.CONDITION.ERROR if a prior condition was ignoredboolean rewrite(byte[] record, byte[] key)
record
- new bytearray of the recordCondition.CONDITION.UNDEFINEDFILE
- if the file is closed,
Condition.CONDITION.ERROR if a prior condition was ignoredboolean deleteByPrimary(byte[] key)
Condition.CONDITION.UNDEFINEDFILE
- if the file is closed,
Condition.CONDITION.ERROR if a prior condition was ignoredboolean delete(byte[] key)
Condition.CONDITION.UNDEFINEDFILE
- if the file is closed,
Condition.CONDITION.ERROR if a prior condition was ignoredboolean isOpen()
boolean delete()
Condition.CONDITION.UNDEFINEDFILE
- if the file is closed,
Condition.CONDITION.ERROR if a prior condition was ignoredvoid close()
Condition.CONDITION.UNDEFINEDFILE
- if the file is closed,
Condition.CONDITION.ERROR if a prior condition was ignoredboolean deleteFile()
Condition.CONDITION.UNDEFINEDFILE
- if the file is closed,
Condition.CONDITION.ERROR if a prior condition was ignored