BIT string mapping from PL/I to Java
The PL/I BIT string type is mapped to the boolean type or the BitSet class in Java™, depending on the length of the bit.
- A BIT string that uses the VARYING attribute is always mapped to the BitSet class.
- A BIT string that uses the REFER option is not supported.
The indexing in the Java BitSet and the PL/I BIT string is different. Indexing starts from 0 in the Java BitSet and from 1 in the PL/I BIT string.
Single-bit BIT strings
If a string has one bit, the PL/I BIT string type is mapped to the Java boolean type.
Multiple-bit BIT strings
The multiple-bit BIT strings are mapped to the BitSet class in Java.
You can author rules by using specific operations that are defined in the BitSet class in two ways.
In technical rules, you can use BitSet and its operations directly when you author rules.
In action rules, you can create a BOM entry by importing the Java.util.BitSet
class and defining the vocabulary so that the BitSet operations can be used. A JDK XOM entry point
is provided to import the Java.util.BitSet XOM element.
01 Loan,
02 approved bit,
02 type bit(4),
02 amount fixed dec(10),
02 expiredate fixed dec(8);It is mapped to the following Java data structure:public class Loan{
private boolean approved;
private BitSet type;
private long amount;
private int expiredate;
}