Open topic with navigation

TIBCO Rendezvous® 8.7.0

# Add Scalar

Convenience Methods

## Declaration

    void add(
        java.lang.String fieldName,
        scalar_type data)
      throws TibrvException
    void add(
        java.lang.String fieldName,
        scalar_type data,
        int fieldId)
      throws TibrvException
    void addUbits(
        java.lang.String fieldName,
        scalar_type data)
      throws TibrvException
    void addUbits(
        java.lang.String fieldName,
        scalar_type data,
        int fieldId)
      throws TibrvException

## Purpose

Add a field containing a scalar value.

## Method Forms

The convenience methods named `add``()` determine the field type from the numeric type of the data.

The convenience methods named `addU` `nn``()` add unsigned integer fields, discarding the sign bit of a Java integer data value.

Method Name | Java Data Type | Field Type | Type Description
`add` | `boolean` | `TibrvMsg.``BOOL` | boolean
`add` | `float` | `TibrvMsg.``F32` | 32-bit floating point
`add` | `double` | `TibrvMsg.``F64` | 64-bit floating point
`add` | `byte` | `TibrvMsg.``I8` | 8-bit integer
`add` | `short` | `TibrvMsg.``I16` | 16-bit integer
`add` | `int` | `TibrvMsg.``I32` | 32-bit integer
`add` | `long` | `TibrvMsg.``I64` | 64-bit integer
`add` `U8` | `byte` | `TibrvMsg.``U8` | 8-bit unsigned integer
`add` `U16` | `short` | `TibrvMsg.``U16` | 16-bit unsigned integer
`add` `U32` | `int` | `TibrvMsg.``U32` | 32-bit unsigned integer
`add` `U64` | `long` | `TibrvMsg.``U64` | 64-bit unsigned integer

Parameter | Description
`fieldName` | Add a field with this name. `null` is a legal name. However, if `fieldId` is non-zero, then `fieldName` must be non-`null`.
`data` | Add a field with this data value. `null` is illegal.
`fieldId` | Add a field with this identifier. All field identifiers must be unique within each message. When absent, add a field without an identifier. Zero is a special value, indicating no identifier. It is illegal to add a field that has both a `null` field name, and a non-zero field identifier.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Rendezvous®

Copyright © 1997-2023. Cloud Software Group, Inc. All Rights Reserved.