Interface JCoStructure

All Superinterfaces:
Cloneable, Iterable<JCoField>, JCoRecord, Serializable

public interface JCoStructure extends JCoRecord
JCoStructure is for data containers that need a certain layout in memory. Those structures are often defined as parameters in function module parameter lists. Its underlying metadata can also be used for a JCoTable.
  • Method Details

    • getRecordMetaData

      JCoRecordMetaData getRecordMetaData()
      Returns the appropriated metadata object, that was used for creation of this record.
      Returns:
      JCoRecordMetaData instance of the appropriated metadata object
    • getRecordFieldIterator

      JCoRecordFieldIterator getRecordFieldIterator()
      Returns an iterator over JCoRecordField.
      Returns:
      JCoRecordFieldIterator instance
      See Also:
    • getString

      String getString()
      Returns a String containing all fields concatenated to one single String.

      Note: The JCoStructure must be a flat Structure with only simple char-like fields, such as CHAR, NUM, DATE, TIME. The function mimics a 'c-style memcpy'. If the last field is TYPE_CHAR, this method trims all trailing blanks from the returned string. In addition to programming convenience, it should also improve runtime performance compared to fetching each single field one-by-one.

      Returns:
      the value of all fields concatenated as String
      Throws:
      ConversionException - thrown if the values could not be converted to a String or the JCoStructure does contain fields any other than CHAR, NUM, DATE, TIME
      Since:
      JCo 3.1.0
    • setString

      void setString(String fieldsAsString)
      Allows to set all fields of a Structure handed by one single String containing all fields values.

      Note: The JCoStructure must be a flat Structure with only simple char-like fields, such as CHAR, NUM, DATE, TIME. The function mimics a 'c-style memcpy'. In addition to programming convenience, it should also improve runtime performance compared to setting each single field one-by-one. The function will set all fields 'up to', meaning you can provide a much shorter String to set the first fields. If the String is longer than the internal buffer of all fields, the remaining Substring will be ignored. DATE and TIME values inside the String can contain '-' or ':' as formatter.

      Parameters:
      fieldsAsString - the string to set
      Throws:
      ConversionException - thrown if the value could not be converted to its internal representation or the JCoStructure does contain fields any other than CHAR, NUM, DATE, TIME
      Since:
      JCo 3.1.0