All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jtopenlite.com.ibm.jtopenlite.ddm.DDMWriteCallback Maven / Gradle / Ivy

There is a newer version: 20.0.7
Show newest version
///////////////////////////////////////////////////////////////////////////////
//
// JTOpenLite
//
// Filename:  DDMWriteCallback.java
//
// The source code contained herein is licensed under the IBM Public License
// Version 1.0, which has been approved by the Open Source Initiative.
// Copyright (C) 2011-2012 International Business Machines Corporation and
// others.  All rights reserved.
//
///////////////////////////////////////////////////////////////////////////////

package com.ibm.jtopenlite.ddm;

/**
 * Used by DDMConnection to obtain the input for a write operation from the user in a memory-conscious fashion.
 * 

Order of operations: *

    *
  1. DDMConnection.write(file, callback)
  2. *
  3. --> callback.getNumberOfRecords()
  4. *
  5. --> begin loop
  6. *
  7. ------> callback.getRecordData()
  8. *
  9. ------> callback.getRecordDataOffset()
  10. *
  11. ------> callback.getNullFieldValues()
  12. *
  13. ------> Record is written
  14. *
  15. --> end loop
  16. *
**/ public interface DDMWriteCallback { /** * Returns the number of records to write, which is how many times the DDMConnection will call getRecordData() for a given write operation. **/ public int getNumberOfRecords(DDMCallbackEvent event); /** * Returns the record data to write. **/ public byte[] getRecordData(DDMCallbackEvent event, int recordIndex); /** * Returns the offset into the byte array returned by the prior call to getRecordData() so that a single buffer can be used to write multiple records. **/ public int getRecordDataOffset(DDMCallbackEvent event, int recordIndex); /** * Returns the array of null field values, one for each field in the record to be written. * Returning null indicates no fields should be written with a value of null. **/ public boolean[] getNullFieldValues(DDMCallbackEvent event, int recordIndex); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy