Java Code Examples for org.omg.CORBA.TCKind.tk_octet()

The following are Jave code examples for showing how to use tk_octet() of the org.omg.CORBA.TCKind class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: OpenJSharp   File: TypeCodeImpl.java   View Source Code Vote up 5 votes
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    TypeCode discriminator_type,
                    UnionMember[] members)
                    // for unions
{
    this(orb) ;

    if (creationKind == TCKind._tk_union) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;
        _discriminator      = convertToNative(_orb, discriminator_type);

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];
        _unionLabels = new AnyImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
            _unionLabels[i] = new AnyImpl(_orb, members[i].label);
            // check whether this is the default branch.
            if (_unionLabels[i].type().kind() == TCKind.tk_octet) {
                if (_unionLabels[i].extract_octet() == (byte)0) {
                    _defaultIndex = i;
                }
            }
        }
    } // else initializes to null
}
 
Example 2
Project: openjdk-jdk10   File: TypeCodeImpl.java   View Source Code Vote up 5 votes
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    TypeCode discriminator_type,
                    UnionMember[] members)
                    // for unions
{
    this(orb) ;

    if (creationKind == TCKind._tk_union) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;
        _discriminator      = convertToNative(_orb, discriminator_type);

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];
        _unionLabels = new AnyImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
            _unionLabels[i] = new AnyImpl(_orb, members[i].label);
            // check whether this is the default branch.
            if (_unionLabels[i].type().kind() == TCKind.tk_octet) {
                if (_unionLabels[i].extract_octet() == (byte)0) {
                    _defaultIndex = i;
                }
            }
        }
    } // else initializes to null
}