FileDocCategorySizeDatePackage
DynAnyConstructedImpl.javaAPI DocJava SE 6 API34477Tue Jun 10 00:21:32 BST 2008com.sun.corba.se.impl.dynamicany

DynAnyConstructedImpl

public abstract class DynAnyConstructedImpl extends DynAnyImpl

Fields Summary
protected static final byte
REPRESENTATION_NONE
protected static final byte
REPRESENTATION_TYPECODE
protected static final byte
REPRESENTATION_ANY
protected static final byte
REPRESENTATION_COMPONENTS
protected static final byte
RECURSIVE_UNDEF
protected static final byte
RECURSIVE_NO
protected static final byte
RECURSIVE_YES
protected static final DynAny[]
emptyComponents
DynAny[]
components
byte
representations
byte
isRecursive
Constructors Summary
private DynAnyConstructedImpl()


    //
    // Constructors
    //

      
        this(null, (Any)null, false);
    
protected DynAnyConstructedImpl(ORB orb, Any any, boolean copyValue)

        super(orb, any, copyValue);
        //System.out.println(this + " constructed with any " + any);
        if (this.any != null) {
            representations = REPRESENTATION_ANY;
        }
        // set the current position to 0 if any has components, otherwise to -1.
        index = 0;
    
protected DynAnyConstructedImpl(ORB orb, TypeCode typeCode)

        // assertion: typeCode has been checked to be valid for this particular subclass.
        // note: We don't copy TypeCodes since they are considered immutable.
        super(orb, typeCode);
        if (typeCode != null) {
            representations = REPRESENTATION_TYPECODE;
        }
        // set the current position to 0 if any has components, otherwise to -1.
        index = NO_INDEX;

        // _REVISIT_ Would need REPRESENTATION_TYPECODE for lazy initialization
        //if ( ! isRecursive()) {
        //    initializeComponentsFromTypeCode();
        //}
    
Methods Summary
public voidassign(org.omg.DynamicAny.DynAny dyn_any)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
        clearData();
        super.assign(dyn_any);
        representations = REPRESENTATION_ANY;
        index = 0;
    
protected voidcheckInitAny()

        if ((representations & REPRESENTATION_ANY) == 0) {
            //System.out.println(this + " checkInitAny: reps does not have REPRESENTATION_ANY");
            if ((representations & REPRESENTATION_COMPONENTS) != 0) {
                //System.out.println(this + " checkInitAny: reps has REPRESENTATION_COMPONENTS");
                if (initializeAnyFromComponents()) {
                    representations |= REPRESENTATION_ANY;
                }
            } else if ((representations & REPRESENTATION_TYPECODE) != 0) {
                //System.out.println(this + " checkInitAny: reps has REPRESENTATION_TYPECODE");
                if (representations == REPRESENTATION_TYPECODE && isRecursive())
                    return;
                if (initializeComponentsFromTypeCode()) {
                    representations |= REPRESENTATION_COMPONENTS;
                }
                if (initializeAnyFromComponents()) {
                    representations |= REPRESENTATION_ANY;
                }
            }
        } else {
            //System.out.println(this + " checkInitAny: reps != REPRESENTATION_ANY");
        }
        return;
    
protected booleancheckInitComponents()

        if ((representations & REPRESENTATION_COMPONENTS) == 0) {
            if ((representations & REPRESENTATION_ANY) != 0) {
                if (initializeComponentsFromAny()) {
                    representations |= REPRESENTATION_COMPONENTS;
                } else {
                    return false;
                }
            } else if ((representations & REPRESENTATION_TYPECODE) != 0) {
                if (initializeComponentsFromTypeCode()) {
                    representations |= REPRESENTATION_COMPONENTS;
                } else {
                    return false;
                }
            }
        }
        return true;
    
protected voidclearData()

        super.clearData();
        // _REVISIT_ What about status?
        components = emptyComponents;
        index = NO_INDEX;
        representations = REPRESENTATION_NONE;
    
public intcomponent_count()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
        return (checkInitComponents() ? components.length : 0);
    
public org.omg.DynamicAny.DynAnycopy()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
        checkInitAny();
        try {
            return DynAnyUtil.createMostDerivedDynAny(any, orb, true);
        } catch (InconsistentTypeCode ictc) {
            return null; // impossible
        }
    
public org.omg.DynamicAny.DynAnycurrent_component()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
        if (index == NO_INDEX) {
            return null;
        }
        return (checkInitComponents() ? components[index] : null);
    
public voiddestroy()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
        if (status == STATUS_DESTROYABLE) {
            status = STATUS_DESTROYED;
            for (int i=0; i<components.length; i++) {
                if (components[i] instanceof DynAnyImpl) {
                    ((DynAnyImpl)components[i]).setStatus(STATUS_DESTROYABLE);
                }
                components[i].destroy();
            }
        }
    
public booleanequal(org.omg.DynamicAny.DynAny dyn_any)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
        if (dyn_any == this) {
            return true;
        }
        if ( ! any.type().equal(dyn_any.type())) {
            return false;
        }
        // This changes the current position of dyn_any.
        // Make sure that our position isn't changed.
        if (checkInitComponents() == false) {
            return false;
        }
        DynAny currentComponent = null;
        try {
            // Remember the current position to restore it later
            currentComponent = dyn_any.current_component();
            for (int i=0; i<components.length; i++) {
                if (dyn_any.seek(i) == false)
                    return false;
                //System.out.println(this + " comparing component " + i + "=" + components[i] +
                //                   " of type " + components[i].type().kind().value());
                if ( ! components[i].equal(dyn_any.current_component())) {
                    //System.out.println("Not equal component " + i);
                    return false;
                }
            }
        } catch (TypeMismatch tm) {
            // impossible, we checked the type codes already
        } finally {
            // Restore the current position of the other DynAny
            DynAnyUtil.set_current_component(dyn_any, currentComponent);
        }
        return true;
    
public voidfrom_any(org.omg.CORBA.Any value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
        clearData();
        super.from_any(value);
        representations = REPRESENTATION_ANY;
        index = 0;
    
public org.omg.CORBA.Anyget_any()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_any();
    
public booleanget_boolean()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_boolean();
    
public charget_char()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_char();
    
public doubleget_double()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_double();
    
public org.omg.DynamicAny.DynAnyget_dyn_any()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_dyn_any();
    
public floatget_float()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_float();
    
public intget_long()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_long();
    
public longget_longlong()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_longlong();
    
public byteget_octet()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_octet();
    
public org.omg.CORBA.Objectget_reference()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_reference();
    
public shortget_short()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_short();
    
public java.lang.Stringget_string()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_string();
    
public org.omg.CORBA.TypeCodeget_typecode()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_typecode();
    
public intget_ulong()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_ulong();
    
public longget_ulonglong()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_ulonglong();
    
public shortget_ushort()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_ushort();
    
public java.io.Serializableget_val()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_val();
    
public charget_wchar()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_wchar();
    
public java.lang.Stringget_wstring()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        return currentComponent.get_wstring();
    
protected booleaninitializeAnyFromComponents()

        //System.out.println(this + " initializeAnyFromComponents");
        OutputStream out = any.create_output_stream();
        for (int i=0; i<components.length; i++) {
            if (components[i] instanceof DynAnyImpl) {
                ((DynAnyImpl)components[i]).writeAny(out);
            } else {
                // Not our implementation. Nothing we can do to prevent copying.
                components[i].to_any().write_value(out);
            }
        }
        any.read_value(out.create_input_stream(), any.type());
        return true;
    
protected abstract booleaninitializeComponentsFromAny()

protected abstract booleaninitializeComponentsFromTypeCode()

public voidinsert_any(org.omg.CORBA.Any value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_any(value);
    
public voidinsert_boolean(boolean value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_boolean(value);
    
public voidinsert_char(char value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_char(value);
    
public voidinsert_double(double value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_double(value);
    
public voidinsert_dyn_any(org.omg.DynamicAny.DynAny value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_dyn_any(value);
    
public voidinsert_float(float value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_float(value);
    
public voidinsert_long(int value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_long(value);
    
public voidinsert_longlong(long value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_longlong(value);
    
public voidinsert_octet(byte value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_octet(value);
    
public voidinsert_reference(org.omg.CORBA.Object value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_reference(value);
    
public voidinsert_short(short value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_short(value);
    
public voidinsert_string(java.lang.String value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_string(value);
    
public voidinsert_typecode(org.omg.CORBA.TypeCode value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_typecode(value);
    
public voidinsert_ulong(int value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_ulong(value);
    
public voidinsert_ulonglong(long value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_ulonglong(value);
    
public voidinsert_ushort(short value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_ushort(value);
    
public voidinsert_val(java.io.Serializable value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_val(value);
    
public voidinsert_wchar(char value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_wchar(value);
    
public voidinsert_wstring(java.lang.String value)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	if (index == NO_INDEX)
            throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
        DynAny currentComponent = current_component();
        if (DynAnyUtil.isConstructedDynAny(currentComponent))
            throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
        currentComponent.insert_wstring(value);
    
protected booleanisRecursive()

        if (isRecursive == RECURSIVE_UNDEF) {
            TypeCode typeCode = any.type();
            if (typeCode instanceof TypeCodeImpl) {
                if (((TypeCodeImpl)typeCode).is_recursive())
                    isRecursive = RECURSIVE_YES;
                else
                    isRecursive = RECURSIVE_NO;
            } else {
                // No way to find out unless the TypeCode spec changes.
                isRecursive = RECURSIVE_NO;
            }
        }
        return (isRecursive == RECURSIVE_YES);
    
public booleannext()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
        if (checkInitComponents() == false) {
            return false;
        }
        index++;
        if (index >= 0 && index < components.length) {
            return true;
        } else {
            index = NO_INDEX;
            return false;
        }
    
public voidrewind()

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
        this.seek(0);
    
public booleanseek(int newIndex)

        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
        if (newIndex < 0) {
            this.index = NO_INDEX;
            return false;
        }
        if (checkInitComponents() == false) {
            return false;
        }
        if (newIndex < components.length) {
            index = newIndex;
            return true;
        }
        return false;
    
public org.omg.CORBA.Anyto_any()

        //System.out.println(this + " to_any ");
        if (status == STATUS_DESTROYED) {
	    throw wrapper.dynAnyDestroyed() ;
        }
	checkInitAny();
        // Anys value may still be uninitialized if DynAny was initialized by TypeCode only
	return DynAnyUtil.copy(any, orb);
    
protected voidwriteAny(org.omg.CORBA.portable.OutputStream out)

        // If all we got is TypeCode representation (no value)
        // then we don't want to force creating a default value
        //System.out.println(this + " checkInitAny before writeAny");
        checkInitAny();
        super.writeAny(out);