com.SoftWoehr.JTOpenContrib.MEU
Class MEUEditRow

java.lang.Object
  |
  +--com.SoftWoehr.JTOpenContrib.MEU.MEUEditRow

public class MEUEditRow
extends java.lang.Object

Class originally intended to represent one row of the document, now mostly consists of methods for the border between the "record" metaphor and the "row" being edited in unicode in a hightly stream-oriented document architecture.


Method Summary
 boolean appendCopyOf(com.ibm.as400.access.Record sourceRecord)
          Append a copy of a record a last record.
 boolean appendRow(com.ibm.as400.access.Record record)
          Append a record to the file.
 boolean appendRow(java.lang.String contents)
          Append a record to the file with srcdta contents.
 java.math.BigDecimal calcSRCDAT()
          Make the big decimal needed to create a SRCDAT timestamp (YYMMDD)
 java.math.BigDecimal calcSRCSEQ(int pos)
          Calcs next srcseq by 1.00 increments
 void close()
          Close and discard
 boolean copyRowAfter(int fromPos, int precederPos)
          Copy a record after a specific position.
 boolean copyRowBefore(int fromPos, int followerPos)
          Copy a row to before another row
 boolean createMember(java.lang.String description)
          Create the new member.
 java.lang.String fromRow(int pos)
          Get the contents of a row in a form suitable for editing.
 java.lang.String fromRows(int pos, int postindex)
          Make a string equivalent to all the rows desired, appending newlines to each but the last.
 MEUFileMember getFileMember()
          Return the filemember associated with this object.
 java.lang.String getIFSPath()
          Get path of file member
 int getNumberOfDisplayColumns()
          Return number of columns used to display a row including sequence and date
 int getNumberOfRows()
          Get number of records, really
 com.ibm.as400.access.RecordFormat getRecordFormat()
          Return the record format or null if it couldn't be gotten.
 java.lang.String getSRCDTAcontents(int rownum)
          Return the contents of a SRCDTA field
 int getSRCDTAlength()
          Return length of SRCDTA field
 boolean insertAllRowsFrom(int rownum, MEUEditRow rows)
           
 boolean insertCopyOf(com.ibm.as400.access.Record sourceRecord, int pos)
          Insert a copy of a record at the position indicated, pushing all after back.
 boolean insertRow(com.ibm.as400.access.Record record, int pos)
          Create a new row at pos using record as the source
 boolean insertRow(java.lang.String row, int pos)
          Insert a new row into the records of the MEUFileMember based on a string to be the data contents.
static void main(java.lang.String[] argv)
          Just a quick test of record access
 java.lang.String messageRow(java.lang.String msg)
          Return a **** MESSAGE **** row.
 boolean moveRowAfter(int fromPos, int precederPos)
          Move a record after a specific position.
 boolean moveRowBefore(int fromPos, int followerPos)
          Move a record before a specific position.
 boolean readAll()
          Load all rows from the file member on server.
 java.lang.String recordsToString()
          Return all records as a string
 boolean removeRow(int pos)
          Delete a row.
 boolean replaceWithAllFrom(MEUEditRow rows)
          Empty and replace with copies of all the rows from another MEUEditRow object.
 boolean setRecordFormat()
          Cause the record format to be fetched
 boolean setRecordFormat(com.ibm.as400.access.RecordFormat rf)
          Set record format if not open, also clearing records.
static void testRead(java.lang.String server, java.lang.String lib, java.lang.String file, java.lang.String member)
          Read in rows and display
static void testWrite(java.lang.String server, java.lang.String lib, java.lang.String file, java.lang.String member)
          Read in rows, display, modify, and write out
 boolean updateRow(int pos, java.lang.String contents)
          Give new contents to a row.
 boolean writeAll()
          Clear member on the server and write all rows out fresh into empty member.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getIFSPath

public java.lang.String getIFSPath()
Get path of file member

readAll

public boolean readAll()
Load all rows from the file member on server. Returns true if load appears successful

createMember

public boolean createMember(java.lang.String description)
Create the new member. We do not create files, ergo, the record format should always be obtainable from the extant file.

writeAll

public boolean writeAll()
Clear member on the server and write all rows out fresh into empty member.

getFileMember

public MEUFileMember getFileMember()
Return the filemember associated with this object.

setRecordFormat

public boolean setRecordFormat()
Cause the record format to be fetched

setRecordFormat

public boolean setRecordFormat(com.ibm.as400.access.RecordFormat rf)
                        throws java.beans.PropertyVetoException
Set record format if not open, also clearing records. Return false if open.

getRecordFormat

public com.ibm.as400.access.RecordFormat getRecordFormat()
Return the record format or null if it couldn't be gotten.

getSRCDTAlength

public int getSRCDTAlength()
Return length of SRCDTA field

getSRCDTAcontents

public java.lang.String getSRCDTAcontents(int rownum)
Return the contents of a SRCDTA field

getNumberOfRows

public int getNumberOfRows()
Get number of records, really

getNumberOfDisplayColumns

public int getNumberOfDisplayColumns()
Return number of columns used to display a row including sequence and date

recordsToString

public java.lang.String recordsToString()
Return all records as a string

fromRow

public java.lang.String fromRow(int pos)
Get the contents of a row in a form suitable for editing.

messageRow

public java.lang.String messageRow(java.lang.String msg)
Return a **** MESSAGE **** row.

fromRows

public java.lang.String fromRows(int pos,
                                 int postindex)
Make a string equivalent to all the rows desired, appending newlines to each but the last. Starting from -1 means start from "Start of Data" header. Ending with total number of records + 1 means end with "End of Data" footer.

calcSRCDAT

public java.math.BigDecimal calcSRCDAT()
Make the big decimal needed to create a SRCDAT timestamp (YYMMDD)

calcSRCSEQ

public java.math.BigDecimal calcSRCSEQ(int pos)
Calcs next srcseq by 1.00 increments

replaceWithAllFrom

public boolean replaceWithAllFrom(MEUEditRow rows)
Empty and replace with copies of all the rows from another MEUEditRow object. PRESUMES IDENTICAL RECORD FORMAT before call.

insertAllRowsFrom

public boolean insertAllRowsFrom(int rownum,
                                 MEUEditRow rows)

appendCopyOf

public boolean appendCopyOf(com.ibm.as400.access.Record sourceRecord)
Append a copy of a record a last record. Update srcseq and srcdat.

appendRow

public boolean appendRow(com.ibm.as400.access.Record record)
Append a record to the file. Update srcseq and srcdat.

appendRow

public boolean appendRow(java.lang.String contents)
Append a record to the file with srcdta contents. Update srcseq and srcdat.

insertCopyOf

public boolean insertCopyOf(com.ibm.as400.access.Record sourceRecord,
                            int pos)
Insert a copy of a record at the position indicated, pushing all after back.

insertRow

public boolean insertRow(com.ibm.as400.access.Record record,
                         int pos)
Create a new row at pos using record as the source

insertRow

public boolean insertRow(java.lang.String row,
                         int pos)
Insert a new row into the records of the MEUFileMember based on a string to be the data contents.

updateRow

public boolean updateRow(int pos,
                         java.lang.String contents)
Give new contents to a row. Handle last modified date.
Returns:
true if successful.

removeRow

public boolean removeRow(int pos)
Delete a row.

copyRowBefore

public boolean copyRowBefore(int fromPos,
                             int followerPos)
Copy a row to before another row

moveRowBefore

public boolean moveRowBefore(int fromPos,
                             int followerPos)
Move a record before a specific position.

copyRowAfter

public boolean copyRowAfter(int fromPos,
                            int precederPos)
Copy a record after a specific position.

moveRowAfter

public boolean moveRowAfter(int fromPos,
                            int precederPos)
Move a record after a specific position.

close

public void close()
Close and discard

testWrite

public static void testWrite(java.lang.String server,
                             java.lang.String lib,
                             java.lang.String file,
                             java.lang.String member)
Read in rows, display, modify, and write out

testRead

public static void testRead(java.lang.String server,
                            java.lang.String lib,
                            java.lang.String file,
                            java.lang.String member)
Read in rows and display

main

public static void main(java.lang.String[] argv)
Just a quick test of record access